Skip to content

Commit

Permalink
handle possible None value (#15966)
Browse files Browse the repository at this point in the history
  • Loading branch information
zzstoatzz authored Nov 9, 2024
1 parent 6c45d95 commit ae50f95
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/prefect/workers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,8 @@ async def _worker_metadata(self) -> Optional[WorkerMetadata]:
for dist in distributions()
# PyPI packages often use dashes, but Python package names use underscores
# because they must be valid identifiers.
if dist.metadata.get("Name").replace("-", "_") in installed_integrations
if (name := dist.metadata.get("Name"))
and (name.replace("-", "_") in installed_integrations)
]

if integration_versions:
Expand Down

0 comments on commit ae50f95

Please sign in to comment.