-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upstream_output.definition_metadata doesn't contain the metadata since 1.7.11 for observable Source Assets [REGRESSION] #22789
Comments
@garethbrickman Can someone look into this? This breaks all IO managers implementations for source assets |
@garethbrickman Would really appreciate if if you could make some time for this, seems like a relatively major issue. |
Hi @sverbruggen @ion-elgreco , are either of you able to create a minimal reproduction of this issue? My attempts haven't been successful here, generally trying things along these lines: def test_input_manager_with_source_assets() -> None:
fancy_metadata = {"foo": "bar", "baz": 1.23}
upstream = SourceAsset("upstream", metadata=fancy_metadata)
@asset(ins={"upstream": AssetIn(input_manager_key="special_io_manager")})
def downstream(upstream) -> int:
return upstream + 1
class MyIOManager(IOManager):
def load_input(self, context) -> int:
assert context.upstream_output is not None
assert context.upstream_output.asset_key == AssetKey(["upstream"])
assert context.upstream_output.definition_metadata == fancy_metadata
return 2
def handle_output(self, context, obj) -> None: ...
defs = Definitions(
assets=[upstream, downstream],
resources={"special_io_manager": IOManagerDefinition.hardcoded_io_manager(MyIOManager())},
)
job = defs.get_implicit_job_def_for_assets([downstream.key])
assert job is not None
output = job.execute_in_process()
assert output._get_output_for_handle("downstream", "result") == 3 # noqa: SLF001
assert False There was a change which resulted in those system-generated metadata keys (e.g. |
@OwenKephart I have an MRE in my code base, will share it when I arrive back home tonight! |
Thank you! |
@OwenKephart found a way to reproduce it with a slight modification of your example: from dagster import (
AssetIn,
AssetKey,
ConfigurableIOManager, # noqa
DataVersion,
IOManager, # noqa
asset,
materialize,
observable_source_asset,
)
def test_input_manager_with_source_assets() -> None:
fancy_metadata = {"foo": "bar", "baz": 1.23}
@observable_source_asset(metadata=fancy_metadata)
def upstream():
return DataVersion('1')
# upstream = SourceAsset("upstream", metadata=fancy_metadata)
@asset(ins={"upstream": AssetIn(input_manager_key="special_io_manager")})
def downstream(upstream) -> int:
return upstream + 1
class MyIOManager(IOManager):
def load_input(self, context) -> int:
assert context.upstream_output is not None
assert context.upstream_output.asset_key == AssetKey(["upstream"])
assert context.upstream_output.definition_metadata == fancy_metadata
return 2
def handle_output(self, context, obj) -> None: ...
materialize(assets=[upstream,downstream], resources={"special_io_manager": MyIOManager()}) AssertionError: assert {'dagster/io_... 'io_manager'} == {'baz': 1.23, 'foo': 'bar'}
Left contains 1 more item:
{'dagster/io_manager_key': 'io_manager'}
Right contains 2 more items:
{'baz': 1.23, 'foo': 'bar'}
Use -v to get more diff The key is to use observable source assets, and materialize it instead of a job |
@ion-elgreco thanks for the reproduction, we should be able to get a fix in for next week's release |
@OwenKephart thanks!! Much appreciated for the quick fix |
Dagster version
1.7.11
What's the issue?
Since v1.7.11 the
InputContext.upstream_output.definition_metadata
doesn't contain the metadata anymore of the input asset. This is quite problematic since we have IO managers that rely on this metadata of an asset.with v1.7.11
![image](https://private-user-images.githubusercontent.com/15728914/344683021-b8a7cb10-56c1-4d91-8b10-e8ae9a8bcdf6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAzODk3OTMsIm5iZiI6MTcyMDM4OTQ5MywicGF0aCI6Ii8xNTcyODkxNC8zNDQ2ODMwMjEtYjhhN2NiMTAtNTZjMS00ZDkxLThiMTAtZThhZTlhOGJjZGY2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA3VDIxNTgxM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTZmYjQxYTM0MDU4NDMxZmMxODI2N2M5ODcxNjJmYjQ0MmM2OTBlMjY5Nzc1YjNmM2E3NTk5MTEwOWRiZDRiNzAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.ZYT5MgItwLt-YbAGLc95_P_bFA5PtdRe-VQXmVRKMPo)
![image](https://private-user-images.githubusercontent.com/15728914/344689003-f6f6cd67-1a23-4057-aa55-e1fbb57676ed.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAzODk3OTMsIm5iZiI6MTcyMDM4OTQ5MywicGF0aCI6Ii8xNTcyODkxNC8zNDQ2ODkwMDMtZjZmNmNkNjctMWEyMy00MDU3LWFhNTUtZTFmYmI1NzY3NmVkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA3VDIxNTgxM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBjNmUzZGFjMTY3NTg0YmFkYmI3MTA3Y2MyMDcyNDI0ZTcyMTAxNzFmMTc1MTM1ZDVkY2I5MjY4MDE3ZjVjMTcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.5jSLN3LTfAMqaG1nXca-xqyYuPIMj_Wu28d7BUl_5zQ)
with v1.7.10
What did you expect to happen?
No response
How to reproduce?
No response
Deployment type
None
Deployment details
No response
Additional information
No response
Message from the maintainers
Impacted by this issue? Give it a 👍! We factor engagement into prioritization.
The text was updated successfully, but these errors were encountered: