Skip to content

Commit 1c20726

Browse files
committed
pyright
1 parent d2b2743 commit 1c20726

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

python_modules/dagster/dagster/_core/definitions/asset_spec.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -461,5 +461,5 @@ def attach_internal_freshness_policy(spec: AssetSpec, policy: InternalFreshnessP
461461
You can use this in Definitions.map_asset_specs to attach a freshness policy to an asset spec.
462462
"""
463463
return spec.merge_attributes(
464-
metadata={INTERNAL_FRESHNESS_POLICY_METADATA_KEY: serialize_value(policy)}
464+
metadata={INTERNAL_FRESHNESS_POLICY_METADATA_KEY: serialize_value(policy)} # pyright: ignore[reportArgumentType]
465465
)

python_modules/dagster/dagster/_core/definitions/freshness.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def from_asset_spec_metadata(
3838
serialized_policy = metadata.get(INTERNAL_FRESHNESS_POLICY_METADATA_KEY)
3939
if serialized_policy is None:
4040
return None
41-
return deserialize_value(serialized_policy.value, cls)
41+
return deserialize_value(serialized_policy.value, cls) # pyright: ignore
4242

4343
@staticmethod
4444
def time_window(

python_modules/dagster/dagster_tests/asset_defs_tests/test_internal_freshness.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from datetime import timedelta
2+
from typing import Union
23

34
from dagster._core.definitions.asset_key import AssetKey
45
from dagster._core.definitions.asset_spec import AssetSpec, attach_internal_freshness_policy
@@ -137,8 +138,9 @@ def foo_asset():
137138
)
138139

139140
assets_and_specs = mapped_defs.assets
140-
assert len(assets_and_specs) == 3
141+
assert assets_and_specs is not None
141142
for asset_or_spec in assets_and_specs:
143+
assert isinstance(asset_or_spec, Union[AssetsDefinition, AssetSpec])
142144
spec = (
143145
asset_or_spec.get_asset_spec()
144146
if isinstance(asset_or_spec, AssetsDefinition)

python_modules/libraries/dagster-azure/dagster_azure/adls2/io_manager.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def _acquire_lease(self, client: Any, is_rm: bool = False) -> Iterator[str]:
9090
lease_client = self.lease_client_constructor(client=client)
9191
try:
9292
# Unclear why this needs to be type-ignored
93-
lease_client.acquire(lease_duration=self.lease_duration) # type: ignore
93+
lease_client.acquire(lease_duration=self.lease_duration)
9494
yield lease_client.id
9595
finally:
9696
# cannot release a lease on a file that no longer exists, so need to check

0 commit comments

Comments
 (0)