-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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(bigquery): get_catalog_names
#23461
Conversation
5661824
to
34be3ec
Compare
Codecov Report
@@ Coverage Diff @@
## master #23461 +/- ##
==========================================
+ Coverage 67.62% 67.70% +0.08%
==========================================
Files 1914 1914
Lines 73987 74002 +15
Branches 8030 8030
==========================================
+ Hits 50031 50106 +75
+ Misses 21906 21846 -60
Partials 2050 2050
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 3 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
34be3ec
to
363bf9a
Compare
dc4c6e5
to
428f9e5
Compare
invalid_kwargs = [ | ||
{"name": "some_name"}, | ||
{"schema": "some_schema"}, | ||
{"con": "some_con"}, | ||
{"name": "some_name", "con": "some_con"}, | ||
{"name": "some_name", "schema": "some_schema"}, | ||
{"con": "some_con", "schema": "some_schema"}, | ||
] | ||
# Test check for missing schema. | ||
sys.modules["google.oauth2"] = mock.MagicMock() | ||
for invalid_kwarg in invalid_kwargs: | ||
self.assertRaisesRegex( | ||
Exception, | ||
"The table schema must be defined", | ||
BigQueryEngineSpec.df_to_sql, | ||
database=database, | ||
table=Table(table="name"), | ||
df=df, | ||
to_sql_kwargs=invalid_kwarg, | ||
) |
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.
This test made no sense, so I removed it.
0761e4e
to
4d09c1f
Compare
""" | ||
Return the BigQuery client associated with an engine. | ||
""" | ||
if not dependencies_installed: |
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.
It looks like this is just catching a formerly uncaught exception, is that right?
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.
nm, I see where it was caught before with the ImportError
(cherry picked from commit 7a1aa63)
(cherry picked from commit 7a1aa63)
(cherry picked from commit 7a1aa63)
SUMMARY
Implement
get_catalog_names
for BigQuery. This is needed to support catalog-level permissions, and also for #22862.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A
TESTING INSTRUCTIONS
I configured a BigQuery database and ran this script:
When ran, it produced the expected output:
['covid19-293320']
ADDITIONAL INFORMATION