Cross-runtime consistency fixes
还没有人认领这个 Issue。
评估
调研方向
将 contract_event_handler.py、contract_status_changed_event_handler.py 和 publication_evaluation_event_handler.py 与 Java、TypeScript 和 .NET runtime 进行比较。先检查所列出的时间戳、DynamoDB、环境变量、验证和指标行为,然后在可用时运行相关的服务测试。当 Python 处理程序符合所述的跨 runtime 合约,且没有非预期写入或重复指标时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Summary
A set of fixes to align the Python runtime with the other runtimes (Java, TypeScript, .NET) for functional equivalence and cross-runtime consistency.
Contracts Service
Timestamp format (contract_event_handler.py)
create_contract: replaceddatetime.now().strftime("%d/%m/%Y %H:%M:%S")withdatetime.now(timezone.utc).isoformat()for bothcontract_createdandcontract_last_modified_onupdate_contract: replaceddatetime.now().strftime(...)withdatetime.now(timezone.utc).isoformat()- Format change: custom
DD/MM/YYYY HH:MM:SS→ ISO 8601YYYY-MM-DDTHH:MM:SS.ffffff+00:00 - Uses the non-deprecated timezone-aware API (
timezone.utc) instead ofdatetime.utcnow()
DynamoDB attribute name (contract_event_handler.py)
update_contract: changedUpdateExpressionfrom"set contract_status=:t, modified_date=:m"to"set contract_status=:t, contract_last_modified_on=:m"- This corrects a bug where
update_contractwrote to a non-existentmodified_dateattribute instead of the correctcontract_last_modified_onattribute used increate_contract
Observability metrics (contract_event_handler.py)
- Added
metrics.add_metric(name="ContractCreated", unit=MetricUnit.Count, value=1)tocreate_contractsuccess path
Approvals Service
Per-invocation timestamp (contract_status_changed_event_handler.py)
- Removed module-level
now = datetime.now()andcurrent_datevariable assignments - Moved timestamp computation inside the handler function body to ensure each invocation captures its own execution time rather than the container initialisation time
Environment variable error type (contract_status_changed_event_handler.py)
- Replaced
raise InternalServerError(...)withraise EnvironmentError(...)for bothSERVICE_NAMESPACEandCONTRACT_STATUS_TABLEmissing variable checks - Removed the now-unused
InternalServerErrorimport fromaws_lambda_powertools.event_handler.exceptions
Web Service
Evaluation result validation (publication_evaluation_event_handler.py)
- Added validation guard: only updates DynamoDB when
evaluation_resultis"APPROVED"or"DECLINED"(case-insensitive) - Logs a warning and returns without writing to DynamoDB for any other value
Metric name correction (publication_evaluation_event_handler.py)
- Removed duplicate
metrics.add_metric(name="PropertiesAdded", ...)call - Retained
metrics.add_metric(name="PropertiesApproved", ...)as the single metric for this path
- 主要语言
- Python
- 星标
- 47
- 派生
- 20
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
aws-samples/aws-serverless-developer-experience-workshop-python 的其他 Issue
-
Maintenance: function and test files do not match other runtimes可能重新可做 @sliedig 于 1200 天前认领,目前没有进行中的 PR。 未关闭internal pending-release triage
aws-samples/aws-serverless-developer-experience-workshop-python#32 · 已指派 1 人 ·
-
bug triage
难度 3/5 1-2 天 新手友好度 25/100
aws-samples/aws-serverless-developer-experience-workshop-python#30 ·
查看 aws-samples/aws-serverless-developer-experience-workshop-python 的全部 Issue
相似的 Issue
-
correction metadata
难度 2/5 1-3 小时 新手友好度 68/100
acl-org/acl-anthology#10104 · 1 条评论 ·
维护者通常 1 天内回复
-
bug status/needs-triage
难度 2/5 1-3 小时 新手友好度 86/100
prowler-cloud/prowler#12885 · 1 条评论 ·
维护者通常 1 天内回复
-
Bug in GaussianTailProbabilityCalibrator: running_statistics=False still uses a windowed variance未关闭bug good first issue
难度 2/5 1-3 小时 新手友好度 88/100
selimfirat/pysad#107 ·
维护者通常 1 天内回复
-
bug ci-failure high priority
难度 1/5 1 小时以内 新手友好度 88/100
vllm-project/vllm-omni#8194 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复