Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion create_test_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def create_test_instance():
configs = list(CLIENT.list_instance_configs())
if not USE_EMULATOR:
# Filter out non "us" locations
configs = [config for config in configs if "us-south1" in config.name]
configs = [config for config in configs if "us-west1" in config.name]

instance_config = configs[0].name
create_time = str(int(time.time()))
Expand Down
18 changes: 18 additions & 0 deletions google/cloud/sqlalchemy_spanner/sqlalchemy_spanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,24 @@ def create_connect_args(self, url):
{"user_agent": f"gl-{dist.project_name}/{dist.version}"},
)

@engine_to_connection
def get_view_names(self, connection, schema=None, **kw):
sql = """
SELECT table_name
FROM information_schema.views
WHERE TABLE_SCHEMA='{}'
""".format(
schema or ""
)

all_views = []
with connection.connection.database.snapshot() as snap:
rows = list(snap.execute_sql(sql))
for view in rows:
all_views.append(view[0])

return all_views

@engine_to_connection
def get_columns(self, connection, table_name, schema=None, **kw):
"""Get the table columns description.
Expand Down
7 changes: 4 additions & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,18 +141,19 @@ def compliance_test_13(session):
)

session.install(
"pytest",
"pytest-cov",
"pytest-asyncio",
)

session.install("mock")
session.install("-e", ".[tracing]")
session.run("pip", "install", "sqlalchemy>=1.1.13,<=1.3.24", "--force-reinstall")
session.run("pip", "install", "pytest==6.2.2", "--force-reinstall")
session.run("pip", "install", "opentelemetry-api<=1.10", "--force-reinstall")
session.run("pip", "install", "opentelemetry-sdk<=1.10", "--force-reinstall")
session.run("python", "create_test_database.py")
session.run("pip", "install", "pytest==6.2.2", "--force-reinstall")
session.run(
"pip", "install", "pytest-asyncio<0.21.0", "--force-reinstall", "--no-deps"
)

session.run(
"py.test",
Expand Down