mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
feat(SIP-95): new endpoint for table metadata (#28122)
This commit is contained in:
@@ -2031,7 +2031,7 @@ class TestDatabaseApi(SupersetTestCase):
|
||||
if database.backend == "postgresql":
|
||||
response = json.loads(rv.data.decode("utf-8"))
|
||||
schemas = [
|
||||
s[0] for s in database.get_all_table_names_in_schema(schema_name)
|
||||
s[0] for s in database.get_all_table_names_in_schema(None, schema_name)
|
||||
]
|
||||
self.assertEqual(response["count"], len(schemas))
|
||||
for option in response["result"]:
|
||||
|
||||
@@ -73,7 +73,7 @@ def _setup_csv_upload(allowed_schemas: list[str] | None = None):
|
||||
yield
|
||||
|
||||
upload_db = get_upload_db()
|
||||
with upload_db.get_sqla_engine_with_context() as engine:
|
||||
with upload_db.get_sqla_engine() as engine:
|
||||
engine.execute(f"DROP TABLE IF EXISTS {CSV_UPLOAD_TABLE}")
|
||||
engine.execute(f"DROP TABLE IF EXISTS {CSV_UPLOAD_TABLE_W_SCHEMA}")
|
||||
db.session.delete(upload_db)
|
||||
@@ -107,7 +107,7 @@ def test_csv_upload_with_nulls():
|
||||
None,
|
||||
CSVReader({"null_values": ["N/A", "None"]}),
|
||||
).run()
|
||||
with upload_database.get_sqla_engine_with_context() as engine:
|
||||
with upload_database.get_sqla_engine() as engine:
|
||||
data = engine.execute(f"SELECT * from {CSV_UPLOAD_TABLE}").fetchall()
|
||||
assert data == [
|
||||
("name1", None, "city1", "1-1-1980"),
|
||||
|
||||
Reference in New Issue
Block a user