File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 6363 "beautifulsoup4" ,
6464 "black==24.1.1" ,
6565 "cryptography~=41.0.7" ,
66- "dbt-common" ,
6766 "dbt-core" ,
6867 "dbt-duckdb>=1.7.1" ,
6968 "Faker" ,
114113 ],
115114 "dbt" : [
116115 "dbt-core<2" ,
117- "dbt-common" ,
118116 ],
119117 "gcppostgres" : [
120118 "cloud-sql-python-connector[pg8000]" ,
Original file line number Diff line number Diff line change 33import typing as t
44
55import agate
6- from dbt_common .clients import agate_helper
6+
7+ try :
8+ from dbt_common .clients import agate_helper # type: ignore
9+
10+ SUPPORTS_DELIMITER = True
11+ except ImportError :
12+ from dbt .clients import agate_helper # type: ignore
13+
14+ SUPPORTS_DELIMITER = False
715from sqlglot import exp
816
917from sqlmesh .core .model import Model , SeedKind , create_seed_model
@@ -29,7 +37,11 @@ def to_sqlmesh(self, context: DbtContext) -> Model:
2937 seed_path = self .path .absolute ().as_posix ()
3038 kwargs = self .sqlmesh_model_kwargs (context )
3139 if kwargs .get ("columns" ) is None :
32- agate_table = agate_helper .from_csv (seed_path , [], delimiter = self .delimiter )
40+ agate_table = (
41+ agate_helper .from_csv (seed_path , [], delimiter = self .delimiter )
42+ if SUPPORTS_DELIMITER
43+ else agate_helper .from_csv (seed_path , [])
44+ )
3345 kwargs ["columns" ] = {
3446 name : AGATE_TYPE_MAPPING [tpe .__class__ ]
3547 for name , tpe in zip (agate_table .column_names , agate_table .column_types )
You can’t perform that action at this time.
0 commit comments