Skip to content

Commit

Permalink
feat(dbt): Supporting sync columns with --preserve-metadata and --mer…
Browse files Browse the repository at this point in the history
…ge-metadata (#268)

* feat(dbt): Supporting sync columns with --preserve-metadata and --merge-metadata
* Making sync-columns default
  • Loading branch information
Vitor-Avila authored Mar 18, 2024
1 parent 099ba40 commit 73db090
Show file tree
Hide file tree
Showing 6 changed files with 1,258 additions and 1,151 deletions.
12 changes: 12 additions & 0 deletions src/preset_cli/api/clients/superset.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,18 @@ def get_dataset(self, dataset_id: int) -> Any:
"""
return self.get_resource("dataset", dataset_id)

def get_refreshed_dataset_columns(self, dataset_id: int) -> List[Any]:
"""
Return dataset columns.
"""
url = self.baseurl / "datasource/external_metadata/table" / str(dataset_id)
_logger.debug("GET %s", url)
response = self.session.get(url)
validate_response(response)

resource = response.json()
return resource

def get_datasets(self, **kwargs: str) -> List[Any]:
"""
Return datasets, possibly filtered.
Expand Down
2 changes: 1 addition & 1 deletion src/preset_cli/cli/superset/sync/dbt/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,8 +522,8 @@ def dbt_cloud( # pylint: disable=too-many-arguments, too-many-locals
preserve_columns: bool = False,
preserve_metadata: bool = False,
merge_metadata: bool = False,
raise_failures: bool = False,
access_url: Optional[str] = None,
raise_failures: bool = False,
) -> None:
"""
Sync models/metrics from dbt Cloud to Superset.
Expand Down
Loading

0 comments on commit 73db090

Please sign in to comment.