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

feat(ingestion): azure-ad stateful ingestion #7701

Conversation

siddiquebagwan
Copy link
Contributor

No description provided.

@github-actions github-actions bot added the ingestion PR or Issue related to the ingestion of metadata label Mar 28, 2023
@@ -529,7 +568,9 @@ def _map_azure_ad_group(self, azure_ad_group):
self.config.azure_ad_response_to_groupname_regex,
)
if not self.config.groups_pattern.allowed(group_name):
self.report.report_filtered(f"{corp_group_urn}")
# lintFix giving error: "StatefulIngestionReport" has no attribute "report_filtered"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add a type annotation for the report type in this class. At the top of the class, add report: AzureSourceReport or similar

Do not use type ignore here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -575,7 +616,9 @@ def _map_azure_ad_users(self, azure_ad_users):
if error_str is not None:
continue
if not self.config.users_pattern.allowed(corp_user_urn):
self.report.report_filtered(f"{corp_user_urn}.*")
# lintFix giving error: "StatefulIngestionReport" has no attribute "report_filtered"
Copy link
Collaborator

Choose a reason for hiding this comment

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

same as above

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

)


def stateful_ingest(
Copy link
Collaborator

Choose a reason for hiding this comment

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

first, this should be named test_stateful_ingest

second, this looks like a lot of copy-pasted code. could you refactor it to reduce the copying?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think that is below.. What if we called this run_ingest_with_state?

Or we refactored into a single run_ingest method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@codecov-commenter
Copy link

codecov-commenter commented Mar 29, 2023

Codecov Report

Patch coverage: 95.83% and project coverage change: +0.01 🎉

Comparison is base (f348113) 74.97% compared to head (58f3039) 74.99%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7701      +/-   ##
==========================================
+ Coverage   74.97%   74.99%   +0.01%     
==========================================
  Files         353      353              
  Lines       35406    35422      +16     
==========================================
+ Hits        26547    26566      +19     
+ Misses       8859     8856       -3     
Flag Coverage Δ
pytest-testIntegration 50.94% <83.33%> (+<0.01%) ⬆️
pytest-testIntegrationBatch1 36.50% <83.33%> (+0.02%) ⬆️
pytest-testQuick 63.59% <95.83%> (+0.01%) ⬆️
pytest-testSlowIntegration 33.00% <83.33%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
.../src/datahub/ingestion/source/identity/azure_ad.py 78.35% <95.83%> (+0.97%) ⬆️

... and 2 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@hsheth2 hsheth2 left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ingestion PR or Issue related to the ingestion of metadata
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants