-
Notifications
You must be signed in to change notification settings - Fork 26
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
Resolve locales warning for providers that end with the locale name #702
Resolve locales warning for providers that end with the locale name #702
Conversation
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the GitHub App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## master #702 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 17 17
Lines 1799 1802 +3
=========================================
+ Hits 1799 1802 +3
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
rdt/transformers/pii/anonymizer.py
Outdated
@@ -81,7 +81,7 @@ def _check_locales(self): | |||
missed_locales = [] | |||
for locale in locales: | |||
spec = importlib.util.find_spec(f'faker.providers.{self.provider_name}.{locale}') | |||
if spec is None: | |||
if spec is None and not self.provider_name.endswith(locale): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it safe to assume that if the provider name ends with the locale, then it exists? Is it possible it's just a bad provider name that ends with a locale
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that you are right, we can improve this by adding .
. to the locale when looking for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant more that I think we should make sure the provider exists still. Like if the locale is already present, extract it and runs it through importlib.util.find_spec(f'faker.providers....
1630a12
to
b09f5a9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing!
Resolves #701
Resolves sdv-dev/SDV#1480