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

Crawler should generate run metadata if output is valid #724

Merged

Conversation

elic-eon
Copy link
Contributor

@elic-eon elic-eon commented Dec 11, 2023

🤔 Why?

We are not generating the run.metadata file if there is an error in __init__ or the config file is not valid.

🤓 What?

  • Wrap the instantiation of the connector in a function and pass it to run_connector.
  • Parse BaseConfig in the cli_main so that we can write the run metadata even it's an invalid config file.
  • Move platform and description out of __init__, and define the two as class variables.

🧪 Tested?

  • Add unit tests
  • Verified the run metadata generated for invalid config or wrong creds

☑️ Checks

  • My PR contains actual code changes, and I have updated the version number in pyproject.toml.

Copy link

This pull request has been linked to Shortcut Story #22889: Not all crawler fail generate run metadata.

Copy link

github-actions bot commented Dec 11, 2023

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
14416 13248 92% 85% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
metaphor/azure_data_factory/extractor.py 94% 🟢
metaphor/bigquery/extractor.py 81% 🟢
metaphor/bigquery/lineage/extractor.py 84% 🟢
metaphor/bigquery/profile/extractor.py 61% 🟢
metaphor/common/base_config.py 100% 🟢
metaphor/common/base_extractor.py 100% 🟢
metaphor/common/cli.py 100% 🟢
metaphor/common/runner.py 79% 🟢
metaphor/custom/data_quality/extractor.py 96% 🟢
metaphor/custom/governance/extractor.py 96% 🟢
metaphor/custom/lineage/extractor.py 97% 🟢
metaphor/custom/metadata/extractor.py 96% 🟢
metaphor/custom/query_attributions/extractor.py 95% 🟢
metaphor/dbt/cloud/extractor.py 92% 🟢
metaphor/dbt/extractor.py 98% 🟢
metaphor/fivetran/extractor.py 92% 🟢
metaphor/glue/extractor.py 92% 🟢
metaphor/kafka/extractor.py 93% 🟢
metaphor/looker/extractor.py 69% 🟢
metaphor/metabase/extractor.py 73% 🟢
metaphor/monte_carlo/extractor.py 87% 🟢
metaphor/mssql/extractor.py 94% 🟢
metaphor/mysql/extractor.py 88% 🟢
metaphor/postgresql/extractor.py 42% 🟢
metaphor/postgresql/profile/extractor.py 70% 🟢
metaphor/postgresql/usage/extractor.py 0% 🟢
metaphor/power_bi/extractor.py 89% 🟢
metaphor/redshift/extractor.py 53% 🟢
metaphor/redshift/lineage/extractor.py 89% 🟢
metaphor/redshift/profile/extractor.py 92% 🟢
metaphor/snowflake/extractor.py 81% 🟢
metaphor/snowflake/lineage/extractor.py 68% 🟢
metaphor/snowflake/profile/extractor.py 81% 🟢
metaphor/synapse/extractor.py 90% 🟢
metaphor/tableau/extractor.py 87% 🟢
metaphor/thought_spot/extractor.py 91% 🟢
metaphor/trino/extractor.py 93% 🟢
metaphor/unity_catalog/extractor.py 94% 🟢
metaphor/unity_catalog/profile/extractor.py 94% 🟢
TOTAL 84% 🟢

updated for commit: 6c11417 by action🐍

Copy link

codecov bot commented Dec 11, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (085aa80) 91.21% compared to head (6c11417) 91.89%.

Files Patch % Lines
metaphor/fivetran/extractor.py 60.00% 2 Missing ⚠️
metaphor/postgresql/usage/extractor.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #724      +/-   ##
==========================================
+ Coverage   91.21%   91.89%   +0.68%     
==========================================
  Files         172      137      -35     
  Lines       14486    14416      -70     
==========================================
+ Hits        13213    13248      +35     
+ Misses       1273     1168     -105     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

mars-lan
mars-lan previously approved these changes Dec 13, 2023
Copy link
Contributor

@mars-lan mars-lan left a comment

Choose a reason for hiding this comment

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

Thanks for the refactoring!

metaphor/fivetran/extractor.py Outdated Show resolved Hide resolved
metaphor/monte_carlo/extractor.py Outdated Show resolved Hide resolved
@elic-eon elic-eon merged commit c2c8f31 into main Dec 13, 2023
6 checks passed
@elic-eon elic-eon deleted the scotthuang/sc-22889/not-all-crawler-fail-generate-run-metadata branch December 13, 2023 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants