altimate-datapilot-cli 0.0.13__py3-none-any.whl → 0.0.15__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {altimate_datapilot_cli-0.0.13.dist-info → altimate_datapilot_cli-0.0.15.dist-info}/METADATA +7 -6
- {altimate_datapilot_cli-0.0.13.dist-info → altimate_datapilot_cli-0.0.15.dist-info}/RECORD +32 -28
- {altimate_datapilot_cli-0.0.13.dist-info → altimate_datapilot_cli-0.0.15.dist-info}/WHEEL +1 -1
- datapilot/__init__.py +1 -1
- datapilot/clients/altimate/client.py +18 -1
- datapilot/clients/altimate/utils.py +30 -0
- datapilot/constants.py +7 -0
- datapilot/core/insights/sql/base/insight.py +2 -9
- datapilot/core/platforms/dbt/cli/cli.py +21 -2
- datapilot/core/platforms/dbt/constants.py +2 -0
- datapilot/core/platforms/dbt/executor.py +69 -0
- datapilot/core/platforms/dbt/insights/__init__.py +2 -0
- datapilot/core/platforms/dbt/insights/base.py +3 -0
- datapilot/core/platforms/dbt/insights/checks/check_model_has_labels_keys.py +1 -1
- datapilot/core/platforms/dbt/insights/checks/check_model_has_meta_keys.py +1 -1
- datapilot/core/platforms/dbt/insights/checks/check_source_has_freshness.py +1 -1
- datapilot/core/platforms/dbt/insights/checks/check_source_has_labels_keys.py +1 -1
- datapilot/core/platforms/dbt/insights/checks/check_source_has_meta_keys.py +1 -1
- datapilot/core/platforms/dbt/insights/sql/__init__.py +0 -0
- datapilot/core/platforms/dbt/insights/sql/base.py +23 -0
- datapilot/core/platforms/dbt/insights/sql/sql_check.py +101 -0
- datapilot/core/platforms/dbt/schemas/catalog.py +21 -13
- datapilot/core/platforms/dbt/schemas/manifest.py +41 -27
- datapilot/core/platforms/dbt/wrappers/manifest/v10/wrapper.py +82 -64
- datapilot/core/platforms/dbt/wrappers/manifest/v11/wrapper.py +93 -75
- datapilot/core/platforms/dbt/wrappers/manifest/v12/schemas.py +13 -13
- datapilot/core/platforms/dbt/wrappers/manifest/v12/wrapper.py +25 -19
- datapilot/core/platforms/dbt/wrappers/manifest/wrapper.py +5 -0
- {altimate_datapilot_cli-0.0.13.dist-info → altimate_datapilot_cli-0.0.15.dist-info}/AUTHORS.rst +0 -0
- {altimate_datapilot_cli-0.0.13.dist-info → altimate_datapilot_cli-0.0.15.dist-info}/LICENSE +0 -0
- {altimate_datapilot_cli-0.0.13.dist-info → altimate_datapilot_cli-0.0.15.dist-info}/entry_points.txt +0 -0
- {altimate_datapilot_cli-0.0.13.dist-info → altimate_datapilot_cli-0.0.15.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,5 @@
|
|
1
1
|
from typing import Dict
|
2
|
+
from typing import Optional
|
2
3
|
from typing import Set
|
3
4
|
|
4
5
|
from dbt_artifacts_parser.parsers.manifest.manifest_v11 import GenericTestNode
|
@@ -60,13 +61,14 @@ class ManifestV11Wrapper(BaseManifestWrapper):
|
|
60
61
|
language,
|
61
62
|
contract,
|
62
63
|
) = ([], [], None, None, None, None, None, "", "", None)
|
63
|
-
if node.resource_type
|
64
|
+
if node.resource_type != SEED:
|
64
65
|
sources = node.sources
|
65
66
|
metrics = node.metrics
|
66
67
|
depends_on_nodes = node.depends_on.nodes if node.depends_on else None
|
67
68
|
depends_on_macros = node.depends_on.macros if node.depends_on else None
|
68
69
|
compiled_path = node.compiled_path
|
69
70
|
compiled = node.compiled
|
71
|
+
compiled_code = node.compiled_code
|
70
72
|
raw_code = node.raw_code
|
71
73
|
language = node.language
|
72
74
|
contract = AltimateDBTContract(**node.contract.__dict__) if node.contract else None
|
@@ -75,7 +77,7 @@ class ManifestV11Wrapper(BaseManifestWrapper):
|
|
75
77
|
database=node.database,
|
76
78
|
schema_name=node.schema_,
|
77
79
|
name=node.name,
|
78
|
-
resource_type=AltimateResourceType(node.resource_type
|
80
|
+
resource_type=AltimateResourceType(node.resource_type),
|
79
81
|
package_name=node.package_name,
|
80
82
|
path=node.path,
|
81
83
|
description=node.description,
|
@@ -114,12 +116,13 @@ class ManifestV11Wrapper(BaseManifestWrapper):
|
|
114
116
|
contract=contract,
|
115
117
|
meta=node.meta,
|
116
118
|
patch_path=node.patch_path,
|
119
|
+
access=node.access.value,
|
117
120
|
)
|
118
121
|
|
119
122
|
def _get_source(self, source: SourceNode) -> AltimateManifestSourceNode:
|
120
123
|
return AltimateManifestSourceNode(
|
121
124
|
database=source.database,
|
122
|
-
resource_type=AltimateResourceType(source.resource_type
|
125
|
+
resource_type=AltimateResourceType(source.resource_type),
|
123
126
|
schema_name=source.schema_,
|
124
127
|
name=source.name,
|
125
128
|
package_name=source.package_name,
|
@@ -131,10 +134,10 @@ class ManifestV11Wrapper(BaseManifestWrapper):
|
|
131
134
|
source_description=source.source_description,
|
132
135
|
loader=source.loader,
|
133
136
|
identifier=source.identifier,
|
134
|
-
quoting=AltimateQuoting(**source.quoting.
|
137
|
+
quoting=AltimateQuoting(**source.quoting.model_dump()) if source.quoting else None,
|
135
138
|
loaded_at_field=source.loaded_at_field,
|
136
|
-
freshness=AltimateFreshnessThreshold(**source.freshness.
|
137
|
-
external=AltimateExternalTable(**source.external.
|
139
|
+
freshness=AltimateFreshnessThreshold(**source.freshness.model_dump()) if source.freshness else None,
|
140
|
+
external=AltimateExternalTable(**source.external.model_dump()) if source.external else None,
|
138
141
|
description=source.description,
|
139
142
|
columns={
|
140
143
|
name: AltimateManifestColumnInfo(
|
@@ -151,7 +154,7 @@ class ManifestV11Wrapper(BaseManifestWrapper):
|
|
151
154
|
relation_name=source.relation_name,
|
152
155
|
source_meta=source.source_meta,
|
153
156
|
tags=source.tags,
|
154
|
-
config=AltimateSourceConfig(**source.config.
|
157
|
+
config=AltimateSourceConfig(**source.config.model_dump()) if source.config else None,
|
155
158
|
patch_path=source.patch_path,
|
156
159
|
unrendered_config=source.unrendered_config,
|
157
160
|
created_at=source.created_at,
|
@@ -160,7 +163,7 @@ class ManifestV11Wrapper(BaseManifestWrapper):
|
|
160
163
|
def _get_macro(self, macro: MacroNode) -> AltimateManifestMacroNode:
|
161
164
|
return AltimateManifestMacroNode(
|
162
165
|
name=macro.name,
|
163
|
-
resource_type=AltimateResourceType(macro.resource_type
|
166
|
+
resource_type=AltimateResourceType(macro.resource_type),
|
164
167
|
package_name=macro.package_name,
|
165
168
|
path=macro.path,
|
166
169
|
original_file_path=macro.original_file_path,
|
@@ -175,9 +178,9 @@ class ManifestV11Wrapper(BaseManifestWrapper):
|
|
175
178
|
),
|
176
179
|
description=macro.description,
|
177
180
|
meta=macro.meta,
|
178
|
-
docs=macro.docs,
|
181
|
+
docs=macro.docs.model_dump() if macro.docs else None,
|
179
182
|
patch_path=macro.patch_path,
|
180
|
-
arguments=[AltimateMacroArgument(**arg.
|
183
|
+
arguments=[AltimateMacroArgument(**arg.model_dump()) for arg in macro.arguments] if macro.arguments else None,
|
181
184
|
created_at=macro.created_at,
|
182
185
|
supported_languages=macro.supported_languages,
|
183
186
|
)
|
@@ -185,29 +188,31 @@ class ManifestV11Wrapper(BaseManifestWrapper):
|
|
185
188
|
def _get_exposure(self, exposure: ExposureNode) -> AltimateManifestExposureNode:
|
186
189
|
return AltimateManifestExposureNode(
|
187
190
|
name=exposure.name,
|
188
|
-
resource_type=AltimateResourceType(exposure.resource_type
|
191
|
+
resource_type=AltimateResourceType(exposure.resource_type),
|
189
192
|
package_name=exposure.package_name,
|
190
193
|
path=exposure.path,
|
191
194
|
original_file_path=exposure.original_file_path,
|
192
195
|
unique_id=exposure.unique_id,
|
193
196
|
fqn=exposure.fqn,
|
194
197
|
type=AltimateExposureType(exposure.type.value) if exposure.type else None,
|
195
|
-
owner=AltimateOwner(**exposure.owner.
|
198
|
+
owner=AltimateOwner(**exposure.owner.model_dump()) if exposure.owner else None,
|
196
199
|
description=exposure.description,
|
197
200
|
label=exposure.label,
|
198
201
|
maturity=AltimateMaturityEnum(exposure.maturity.value) if exposure.maturity else None,
|
199
202
|
meta=exposure.meta,
|
200
203
|
tags=exposure.tags,
|
201
|
-
config=AltimateSourceConfig(**exposure.config.
|
204
|
+
config=AltimateSourceConfig(**exposure.config.model_dump()) if exposure.config else None,
|
202
205
|
unrendered_config=exposure.unrendered_config,
|
203
206
|
url=exposure.url,
|
204
|
-
depends_on=
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
207
|
+
depends_on=(
|
208
|
+
AltimateDependsOn(
|
209
|
+
nodes=exposure.depends_on.nodes,
|
210
|
+
macros=exposure.depends_on.macros,
|
211
|
+
)
|
212
|
+
if exposure.depends_on
|
213
|
+
else None
|
214
|
+
),
|
215
|
+
refs=[AltimateRefArgs(**ref.model_dump()) for ref in exposure.refs] if exposure.refs else None,
|
211
216
|
sources=exposure.sources,
|
212
217
|
metrics=exposure.metrics,
|
213
218
|
created_at=exposure.created_at,
|
@@ -217,7 +222,7 @@ class ManifestV11Wrapper(BaseManifestWrapper):
|
|
217
222
|
test_metadata = None
|
218
223
|
if isinstance(test, GenericTestNode):
|
219
224
|
test_type = GENERIC
|
220
|
-
test_metadata = AltimateTestMetadata(**test.test_metadata.
|
225
|
+
test_metadata = AltimateTestMetadata(**test.test_metadata.model_dump()) if test.test_metadata else None
|
221
226
|
elif isinstance(test, SingularTestNode):
|
222
227
|
test_type = SINGULAR
|
223
228
|
else:
|
@@ -226,49 +231,55 @@ class ManifestV11Wrapper(BaseManifestWrapper):
|
|
226
231
|
test_metadata=test_metadata,
|
227
232
|
test_type=test_type,
|
228
233
|
name=test.name,
|
229
|
-
resource_type=AltimateResourceType(test.resource_type
|
234
|
+
resource_type=AltimateResourceType(test.resource_type),
|
230
235
|
package_name=test.package_name,
|
231
236
|
path=test.path,
|
232
237
|
original_file_path=test.original_file_path,
|
233
238
|
unique_id=test.unique_id,
|
234
239
|
fqn=test.fqn,
|
235
240
|
alias=test.alias,
|
236
|
-
checksum=
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
241
|
+
checksum=(
|
242
|
+
AltimateFileHash(
|
243
|
+
name=test.checksum.name,
|
244
|
+
checksum=test.checksum.checksum,
|
245
|
+
)
|
246
|
+
if test.checksum
|
247
|
+
else None
|
248
|
+
),
|
249
|
+
config=AltimateTestConfig(**test.config.model_dump()) if test.config else None,
|
243
250
|
description=test.description,
|
244
251
|
tags=test.tags,
|
245
|
-
columns=
|
246
|
-
|
247
|
-
name
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
252
|
+
columns=(
|
253
|
+
{
|
254
|
+
name: AltimateManifestColumnInfo(
|
255
|
+
name=column.name,
|
256
|
+
description=column.description,
|
257
|
+
meta=column.meta,
|
258
|
+
data_type=column.data_type,
|
259
|
+
quote=column.quote,
|
260
|
+
tags=column.tags,
|
261
|
+
)
|
262
|
+
for name, column in test.columns.items()
|
263
|
+
}
|
264
|
+
if test.columns
|
265
|
+
else None
|
266
|
+
),
|
258
267
|
meta=test.meta,
|
259
268
|
relation_name=test.relation_name,
|
260
269
|
group=test.group,
|
261
270
|
raw_code=test.raw_code,
|
262
271
|
language=test.language,
|
263
|
-
refs=[AltimateRefArgs(**ref.
|
272
|
+
refs=[AltimateRefArgs(**ref.model_dump()) for ref in test.refs] if test.refs else None,
|
264
273
|
sources=test.sources,
|
265
274
|
metrics=test.metrics,
|
266
|
-
depends_on=
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
275
|
+
depends_on=(
|
276
|
+
AltimateDependsOn(
|
277
|
+
nodes=test.depends_on.nodes,
|
278
|
+
macros=test.depends_on.macros,
|
279
|
+
)
|
280
|
+
if test.depends_on
|
281
|
+
else None
|
282
|
+
),
|
272
283
|
compiled_path=test.compiled_path,
|
273
284
|
compiled=test.compiled,
|
274
285
|
compiled_code=test.compiled_code,
|
@@ -279,38 +290,42 @@ class ManifestV11Wrapper(BaseManifestWrapper):
|
|
279
290
|
database=seed.database,
|
280
291
|
schema_name=seed.schema_,
|
281
292
|
name=seed.name,
|
282
|
-
resource_type=AltimateResourceType(seed.resource_type
|
293
|
+
resource_type=AltimateResourceType(seed.resource_type),
|
283
294
|
package_name=seed.package_name,
|
284
295
|
path=seed.path,
|
285
296
|
original_file_path=seed.original_file_path,
|
286
297
|
unique_id=seed.unique_id,
|
287
298
|
fqn=seed.fqn,
|
288
299
|
alias=seed.alias,
|
289
|
-
checksum=
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
300
|
+
checksum=(
|
301
|
+
AltimateFileHash(
|
302
|
+
name=seed.checksum.name,
|
303
|
+
checksum=seed.checksum.checksum,
|
304
|
+
)
|
305
|
+
if seed.checksum
|
306
|
+
else None
|
307
|
+
),
|
308
|
+
config=AltimateSeedConfig(**seed.config.model_dump()) if seed.config else None,
|
296
309
|
description=seed.description,
|
297
310
|
tags=seed.tags,
|
298
|
-
columns=
|
299
|
-
|
300
|
-
name
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
+
columns=(
|
312
|
+
{
|
313
|
+
name: AltimateManifestColumnInfo(
|
314
|
+
name=column.name,
|
315
|
+
description=column.description,
|
316
|
+
meta=column.meta,
|
317
|
+
data_type=column.data_type,
|
318
|
+
quote=column.quote,
|
319
|
+
tags=column.tags,
|
320
|
+
)
|
321
|
+
for name, column in seed.columns.items()
|
322
|
+
}
|
323
|
+
if seed.columns
|
324
|
+
else None
|
325
|
+
),
|
311
326
|
meta=seed.meta,
|
312
327
|
group=seed.group,
|
313
|
-
docs=seed.docs.
|
328
|
+
docs=seed.docs.model_dump() if seed.docs else None,
|
314
329
|
patch_path=seed.patch_path,
|
315
330
|
build_path=seed.build_path,
|
316
331
|
deferred=seed.deferred,
|
@@ -325,7 +340,7 @@ class ManifestV11Wrapper(BaseManifestWrapper):
|
|
325
340
|
nodes = {}
|
326
341
|
for node in self.manifest.nodes.values():
|
327
342
|
if (
|
328
|
-
node.resource_type
|
343
|
+
node.resource_type
|
329
344
|
in [
|
330
345
|
AltimateResourceType.seed.value,
|
331
346
|
AltimateResourceType.test.value,
|
@@ -348,7 +363,7 @@ class ManifestV11Wrapper(BaseManifestWrapper):
|
|
348
363
|
def get_macros(self) -> Dict[str, AltimateManifestMacroNode]:
|
349
364
|
macros = {}
|
350
365
|
for macro in self.manifest.macros.values():
|
351
|
-
if macro.resource_type
|
366
|
+
if macro.resource_type == AltimateResourceType.macro.value and macro.package_name == self.get_package():
|
352
367
|
macros[macro.unique_id] = self._get_macro(macro)
|
353
368
|
return macros
|
354
369
|
|
@@ -369,7 +384,7 @@ class ManifestV11Wrapper(BaseManifestWrapper):
|
|
369
384
|
|
370
385
|
for node in self.manifest.nodes.values():
|
371
386
|
# Check if the node is a test and of the correct type
|
372
|
-
if node.resource_type
|
387
|
+
if node.resource_type == AltimateResourceType.test.value:
|
373
388
|
if any(isinstance(node, t) for t in types):
|
374
389
|
tests[node.unique_id] = self._get_tests(node)
|
375
390
|
return tests
|
@@ -377,10 +392,13 @@ class ManifestV11Wrapper(BaseManifestWrapper):
|
|
377
392
|
def get_seeds(self) -> Dict[str, AltimateSeedNode]:
|
378
393
|
seeds = {}
|
379
394
|
for seed in self.manifest.nodes.values():
|
380
|
-
if seed.resource_type
|
395
|
+
if seed.resource_type == AltimateResourceType.seed.value:
|
381
396
|
seeds[seed.unique_id] = self._get_seed(seed)
|
382
397
|
return seeds
|
383
398
|
|
399
|
+
def get_adapter_type(self) -> Optional[str]:
|
400
|
+
return self.manifest.metadata.adapter_type
|
401
|
+
|
384
402
|
def parent_to_child_map(self, nodes: Dict[str, AltimateManifestNode]) -> Dict[str, Set[str]]:
|
385
403
|
"""
|
386
404
|
Current manifest contains information about parents
|
@@ -4,33 +4,33 @@ from typing import Union
|
|
4
4
|
|
5
5
|
from dbt_artifacts_parser.parsers.manifest.manifest_v12 import Exposures
|
6
6
|
from dbt_artifacts_parser.parsers.manifest.manifest_v12 import Macros
|
7
|
-
from dbt_artifacts_parser.parsers.manifest.manifest_v12 import
|
8
|
-
from dbt_artifacts_parser.parsers.manifest.manifest_v12 import
|
9
|
-
from dbt_artifacts_parser.parsers.manifest.manifest_v12 import
|
10
|
-
from dbt_artifacts_parser.parsers.manifest.manifest_v12 import
|
11
|
-
from dbt_artifacts_parser.parsers.manifest.manifest_v12 import
|
12
|
-
from dbt_artifacts_parser.parsers.manifest.manifest_v12 import
|
13
|
-
from dbt_artifacts_parser.parsers.manifest.manifest_v12 import
|
14
|
-
from dbt_artifacts_parser.parsers.manifest.manifest_v12 import
|
7
|
+
from dbt_artifacts_parser.parsers.manifest.manifest_v12 import Nodes
|
8
|
+
from dbt_artifacts_parser.parsers.manifest.manifest_v12 import Nodes1
|
9
|
+
from dbt_artifacts_parser.parsers.manifest.manifest_v12 import Nodes2
|
10
|
+
from dbt_artifacts_parser.parsers.manifest.manifest_v12 import Nodes3
|
11
|
+
from dbt_artifacts_parser.parsers.manifest.manifest_v12 import Nodes4
|
12
|
+
from dbt_artifacts_parser.parsers.manifest.manifest_v12 import Nodes5
|
13
|
+
from dbt_artifacts_parser.parsers.manifest.manifest_v12 import Nodes6
|
14
|
+
from dbt_artifacts_parser.parsers.manifest.manifest_v12 import Nodes7
|
15
15
|
from dbt_artifacts_parser.parsers.manifest.manifest_v12 import Sources
|
16
16
|
|
17
17
|
from datapilot.core.platforms.dbt.constants import GENERIC
|
18
18
|
from datapilot.core.platforms.dbt.constants import SINGULAR
|
19
19
|
|
20
|
-
ManifestNode = Union[
|
20
|
+
ManifestNode = Union[Nodes, Nodes1, Nodes2, Nodes3, Nodes4, Nodes5, Nodes6, Nodes7]
|
21
21
|
|
22
22
|
SourceNode = Sources
|
23
23
|
|
24
24
|
ExposureNode = Exposures
|
25
25
|
|
26
|
-
TestNode = Union[
|
26
|
+
TestNode = Union[Nodes6, Nodes2]
|
27
27
|
|
28
28
|
MacroNode = Macros
|
29
29
|
|
30
30
|
TEST_TYPE_TO_NODE_MAP: Dict[str, Type] = {
|
31
|
-
GENERIC: [
|
32
|
-
SINGULAR: [
|
31
|
+
GENERIC: [Nodes6],
|
32
|
+
SINGULAR: [Nodes2],
|
33
33
|
}
|
34
34
|
|
35
35
|
|
36
|
-
SeedNodeMap =
|
36
|
+
SeedNodeMap = Nodes
|
@@ -1,9 +1,10 @@
|
|
1
1
|
from typing import Dict
|
2
|
+
from typing import Optional
|
2
3
|
from typing import Set
|
3
4
|
|
4
5
|
from dbt_artifacts_parser.parsers.manifest.manifest_v12 import ManifestV12
|
5
|
-
from dbt_artifacts_parser.parsers.manifest.manifest_v12 import
|
6
|
-
from dbt_artifacts_parser.parsers.manifest.manifest_v12 import
|
6
|
+
from dbt_artifacts_parser.parsers.manifest.manifest_v12 import Nodes2
|
7
|
+
from dbt_artifacts_parser.parsers.manifest.manifest_v12 import Nodes6
|
7
8
|
|
8
9
|
from datapilot.core.platforms.dbt.constants import GENERIC
|
9
10
|
from datapilot.core.platforms.dbt.constants import OTHER_TEST_NODE
|
@@ -67,6 +68,7 @@ class ManifestV12Wrapper(BaseManifestWrapper):
|
|
67
68
|
depends_on_macros = node.depends_on.macros if node.depends_on else None
|
68
69
|
compiled_path = node.compiled_path
|
69
70
|
compiled = node.compiled
|
71
|
+
compiled_code = node.compiled_code
|
70
72
|
raw_code = node.raw_code
|
71
73
|
language = node.language
|
72
74
|
contract = AltimateDBTContract(**node.contract.__dict__) if node.contract else None
|
@@ -114,6 +116,7 @@ class ManifestV12Wrapper(BaseManifestWrapper):
|
|
114
116
|
contract=contract,
|
115
117
|
meta=node.meta,
|
116
118
|
patch_path=node.patch_path,
|
119
|
+
access=node.access.value,
|
117
120
|
)
|
118
121
|
|
119
122
|
def _get_source(self, source: SourceNode) -> AltimateManifestSourceNode:
|
@@ -131,10 +134,10 @@ class ManifestV12Wrapper(BaseManifestWrapper):
|
|
131
134
|
source_description=source.source_description,
|
132
135
|
loader=source.loader,
|
133
136
|
identifier=source.identifier,
|
134
|
-
quoting=AltimateQuoting(**source.quoting.
|
137
|
+
quoting=AltimateQuoting(**source.quoting.model_dump()) if source.quoting else None,
|
135
138
|
loaded_at_field=source.loaded_at_field,
|
136
|
-
freshness=AltimateFreshnessThreshold(**source.freshness.
|
137
|
-
external=AltimateExternalTable(**source.external.
|
139
|
+
freshness=AltimateFreshnessThreshold(**source.freshness.model_dump()) if source.freshness else None,
|
140
|
+
external=AltimateExternalTable(**source.external.model_dump()) if source.external else None,
|
138
141
|
description=source.description,
|
139
142
|
columns={
|
140
143
|
name: AltimateManifestColumnInfo(
|
@@ -151,7 +154,7 @@ class ManifestV12Wrapper(BaseManifestWrapper):
|
|
151
154
|
relation_name=source.relation_name,
|
152
155
|
source_meta=source.source_meta,
|
153
156
|
tags=source.tags,
|
154
|
-
config=AltimateSourceConfig(**source.config.
|
157
|
+
config=AltimateSourceConfig(**source.config.model_dump()) if source.config else None,
|
155
158
|
patch_path=source.patch_path,
|
156
159
|
unrendered_config=source.unrendered_config,
|
157
160
|
created_at=source.created_at,
|
@@ -175,9 +178,9 @@ class ManifestV12Wrapper(BaseManifestWrapper):
|
|
175
178
|
),
|
176
179
|
description=macro.description,
|
177
180
|
meta=macro.meta,
|
178
|
-
docs=macro.docs,
|
181
|
+
docs=macro.docs.model_dump() if macro.docs else None,
|
179
182
|
patch_path=macro.patch_path,
|
180
|
-
arguments=[AltimateMacroArgument(**arg.
|
183
|
+
arguments=[AltimateMacroArgument(**arg.model_dump()) for arg in macro.arguments] if macro.arguments else None,
|
181
184
|
created_at=macro.created_at,
|
182
185
|
supported_languages=macro.supported_languages,
|
183
186
|
)
|
@@ -192,13 +195,13 @@ class ManifestV12Wrapper(BaseManifestWrapper):
|
|
192
195
|
unique_id=exposure.unique_id,
|
193
196
|
fqn=exposure.fqn,
|
194
197
|
type=AltimateExposureType(exposure.type.value) if exposure.type else None,
|
195
|
-
owner=AltimateOwner(**exposure.owner.
|
198
|
+
owner=AltimateOwner(**exposure.owner.model_dump()) if exposure.owner else None,
|
196
199
|
description=exposure.description,
|
197
200
|
label=exposure.label,
|
198
201
|
maturity=AltimateMaturityEnum(exposure.maturity.value) if exposure.maturity else None,
|
199
202
|
meta=exposure.meta,
|
200
203
|
tags=exposure.tags,
|
201
|
-
config=AltimateSourceConfig(**exposure.config.
|
204
|
+
config=AltimateSourceConfig(**exposure.config.model_dump()) if exposure.config else None,
|
202
205
|
unrendered_config=exposure.unrendered_config,
|
203
206
|
url=exposure.url,
|
204
207
|
depends_on=(
|
@@ -209,7 +212,7 @@ class ManifestV12Wrapper(BaseManifestWrapper):
|
|
209
212
|
if exposure.depends_on
|
210
213
|
else None
|
211
214
|
),
|
212
|
-
refs=[AltimateRefArgs(**ref.
|
215
|
+
refs=[AltimateRefArgs(**ref.model_dump()) for ref in exposure.refs] if exposure.refs else None,
|
213
216
|
sources=exposure.sources,
|
214
217
|
metrics=exposure.metrics,
|
215
218
|
created_at=exposure.created_at,
|
@@ -217,10 +220,10 @@ class ManifestV12Wrapper(BaseManifestWrapper):
|
|
217
220
|
|
218
221
|
def _get_tests(self, test: TestNode) -> AltimateManifestTestNode:
|
219
222
|
test_metadata = None
|
220
|
-
if isinstance(test,
|
223
|
+
if isinstance(test, Nodes6):
|
221
224
|
test_type = GENERIC
|
222
|
-
test_metadata = AltimateTestMetadata(**test.test_metadata.
|
223
|
-
elif isinstance(test,
|
225
|
+
test_metadata = AltimateTestMetadata(**test.test_metadata.model_dump()) if test.test_metadata else None
|
226
|
+
elif isinstance(test, Nodes2):
|
224
227
|
test_type = SINGULAR
|
225
228
|
else:
|
226
229
|
test_type = OTHER_TEST_NODE
|
@@ -243,7 +246,7 @@ class ManifestV12Wrapper(BaseManifestWrapper):
|
|
243
246
|
if test.checksum
|
244
247
|
else None
|
245
248
|
),
|
246
|
-
config=AltimateTestConfig(**test.config.
|
249
|
+
config=AltimateTestConfig(**test.config.model_dump()) if test.config else None,
|
247
250
|
description=test.description,
|
248
251
|
tags=test.tags,
|
249
252
|
columns=(
|
@@ -266,7 +269,7 @@ class ManifestV12Wrapper(BaseManifestWrapper):
|
|
266
269
|
group=test.group,
|
267
270
|
raw_code=test.raw_code,
|
268
271
|
language=test.language,
|
269
|
-
refs=[AltimateRefArgs(**ref.
|
272
|
+
refs=[AltimateRefArgs(**ref.model_dump()) for ref in test.refs] if test.refs else None,
|
270
273
|
sources=test.sources,
|
271
274
|
metrics=test.metrics,
|
272
275
|
depends_on=(
|
@@ -302,7 +305,7 @@ class ManifestV12Wrapper(BaseManifestWrapper):
|
|
302
305
|
if seed.checksum
|
303
306
|
else None
|
304
307
|
),
|
305
|
-
config=AltimateSeedConfig(**seed.config.
|
308
|
+
config=AltimateSeedConfig(**seed.config.model_dump()) if seed.config else None,
|
306
309
|
description=seed.description,
|
307
310
|
tags=seed.tags,
|
308
311
|
columns=(
|
@@ -322,7 +325,7 @@ class ManifestV12Wrapper(BaseManifestWrapper):
|
|
322
325
|
),
|
323
326
|
meta=seed.meta,
|
324
327
|
group=seed.group,
|
325
|
-
docs=seed.docs.
|
328
|
+
docs=seed.docs.model_dump() if seed.docs else None,
|
326
329
|
patch_path=seed.patch_path,
|
327
330
|
build_path=seed.build_path,
|
328
331
|
deferred=False,
|
@@ -373,7 +376,7 @@ class ManifestV12Wrapper(BaseManifestWrapper):
|
|
373
376
|
def get_tests(self, type=None) -> Dict[str, AltimateManifestTestNode]:
|
374
377
|
tests = {}
|
375
378
|
# Initialize types_union with TestNode
|
376
|
-
types = [
|
379
|
+
types = [Nodes2, Nodes6]
|
377
380
|
|
378
381
|
# Add other types to the union if provided
|
379
382
|
if type:
|
@@ -393,6 +396,9 @@ class ManifestV12Wrapper(BaseManifestWrapper):
|
|
393
396
|
seeds[seed.unique_id] = self._get_seed(seed)
|
394
397
|
return seeds
|
395
398
|
|
399
|
+
def get_adapter_type(self) -> Optional[str]:
|
400
|
+
return self.manifest.metadata.adapter_type
|
401
|
+
|
396
402
|
def parent_to_child_map(self, nodes: Dict[str, AltimateManifestNode]) -> Dict[str, Set[str]]:
|
397
403
|
"""
|
398
404
|
Current manifest contains information about parents
|
@@ -1,6 +1,7 @@
|
|
1
1
|
from abc import ABC
|
2
2
|
from abc import abstractmethod
|
3
3
|
from typing import Dict
|
4
|
+
from typing import Optional
|
4
5
|
from typing import Set
|
5
6
|
|
6
7
|
from datapilot.core.platforms.dbt.schemas.manifest import AltimateManifestExposureNode
|
@@ -26,6 +27,10 @@ class BaseManifestWrapper(ABC):
|
|
26
27
|
def get_exposures(self) -> Dict[str, AltimateManifestExposureNode]:
|
27
28
|
pass
|
28
29
|
|
30
|
+
@abstractmethod
|
31
|
+
def get_adapter_type(self) -> Optional[str]:
|
32
|
+
pass
|
33
|
+
|
29
34
|
@abstractmethod
|
30
35
|
def parent_to_child_map(self, nodes: Dict[str, AltimateManifestNode]) -> Dict[str, Set[str]]:
|
31
36
|
pass
|
{altimate_datapilot_cli-0.0.13.dist-info → altimate_datapilot_cli-0.0.15.dist-info}/AUTHORS.rst
RENAMED
File without changes
|
File without changes
|
{altimate_datapilot_cli-0.0.13.dist-info → altimate_datapilot_cli-0.0.15.dist-info}/entry_points.txt
RENAMED
File without changes
|
{altimate_datapilot_cli-0.0.13.dist-info → altimate_datapilot_cli-0.0.15.dist-info}/top_level.txt
RENAMED
File without changes
|