Skip to content
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

[BUGFIX] Show FDS Asset name in DataDocs #9950

Merged
merged 15 commits into from
May 21, 2024
Merged

Conversation

Kilo59
Copy link
Member

@Kilo59 Kilo59 commented May 21, 2024

Fix missing Asset Name for Fluent Datasources in the Datadocs Home/index page.

See issue below for detailed description of the problem.

Also updates some related type annotations.

Before

image

After

image

@Kilo59 Kilo59 self-assigned this May 21, 2024
Comment on lines +986 to +987
batch_kwargs = validation_results.meta.get("batch_kwargs", {})
batch_spec = validation_results.meta.get("batch_spec", {})
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of both of these may be going away in V1 but active_batch_definition will still be present.

@Kilo59 Kilo59 added the bug Bugs bugs bugs! label May 21, 2024
@Kilo59 Kilo59 marked this pull request as ready for review May 21, 2024 20:53
Comment on lines +980 to +985
def _resolve_asset_name(validation_results: ExpectationValidationResult) -> str | None:
"""
Resolve the asset name from the validation results meta data.
FDS does not store data_asset_name in batch_kwargs or batch_spec and it must be
pulled from the active batch definition.
"""
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@morphatic Thanks so much for the detailed issue description.
I ended up using exactly what you suggested.

Would you like me to make you a CoAuthor on this PR?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad it helped! I would not complain about being listed as a co-author. Thank you for asking!

Copy link
Contributor

@billdirks billdirks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@@ -4832,7 +4839,7 @@ def get_validation_result( # noqa: PLR0913
# run_id_set = set([key.run_id for key in filtered_key_list])
if len(filtered_key_list) == 0:
logger.warning("No valid run_id values found.")
return {}
return {} # type: ignore[return-value]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe make the return type a union with a dict so you don't have to ignore this here? This may cause you to assert at the call sites though.

Co-authored-by: morphatic <morphatic@users.noreply.github.com>
@Kilo59 Kilo59 enabled auto-merge May 21, 2024 21:43
@Kilo59 Kilo59 added this pull request to the merge queue May 21, 2024
Merged via the queue into 0.18.x with commit 13de093 May 21, 2024
57 checks passed
@Kilo59 Kilo59 deleted the b/lak-981/datadoc-asset branch May 21, 2024 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

data_asset_name can't be specified with fluent datasources for use in data docs
4 participants