File tree Expand file tree Collapse file tree 2 files changed +7
-13
lines changed
CosmoTech_Acceleration_Library Expand file tree Collapse file tree 2 files changed +7
-13
lines changed Original file line number Diff line number Diff line change 1
1
# Copyright (C) - 2023 - 2025 - Cosmo Tech
2
2
# Licensed under the MIT license.
3
3
4
- __version__ = '0.9.3 '
4
+ __version__ = '0.9.4 '
Original file line number Diff line number Diff line change 8
8
from typing import Optional
9
9
from urllib .parse import quote
10
10
11
+ import adbc_driver_manager
11
12
import pyarrow as pa
12
13
from adbc_driver_postgresql import dbapi
13
14
from pyarrow import Table
@@ -66,18 +67,11 @@ def get_postgresql_table_schema(
66
67
67
68
with (dbapi .connect (postgresql_full_uri ) as conn ):
68
69
try :
69
- catalog = conn .adbc_get_objects (depth = "tables" ,
70
- catalog_filter = postgres_db ,
71
- db_schema_filter = postgres_schema ,
72
- table_name_filter = target_table_name ).read_all ().to_pylist ()[0 ]
73
- schema = catalog ["catalog_db_schemas" ][0 ]
74
- table = schema ["db_schema_tables" ][0 ]
75
- if table ["table_name" ] == target_table_name :
76
- return conn .adbc_get_table_schema (
77
- target_table_name ,
78
- db_schema_filter = postgres_schema ,
79
- )
80
- except IndexError :
70
+ return conn .adbc_get_table_schema (
71
+ target_table_name ,
72
+ db_schema_filter = postgres_schema ,
73
+ )
74
+ except adbc_driver_manager .ProgrammingError :
81
75
LOGGER .warning (f"Table { postgres_schema } .{ target_table_name } not found" )
82
76
return None
83
77
You can’t perform that action at this time.
0 commit comments