Skip to content

Commit

Permalink
Merge pull request #35 from chocoapp/feature/DATA-1493-adjust-dbt-params
Browse files Browse the repository at this point in the history
feat: rename profile_name to target_name
  • Loading branch information
claudiazi authored Apr 17, 2024
2 parents 647a740 + f56e6b6 commit 52e7572
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions dagger/dag_creator/airflow/operator_creators/dbt_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ def __init__(self, task, dag):

self._project_dir = task.project_dir
self._profile_dir = task.profile_dir
self._profile_name = task.profile_name
self._target_name = task.target_name
self._select = task.select
self._dbt_command = task.dbt_command

def _generate_command(self):
command = [self._task.executable_prefix, self._task.executable]
command.append(f"--project_dir={self._project_dir}")
command.append(f"--profiles_dir={self._profile_dir}")
command.append(f"--profile_name={self._profile_name}")
command.append(f"--target_name={self._target_name}")
command.append(f"--dbt_command={self._dbt_command}")
if self._select:
command.append(f"--select={self._select}")
Expand Down
8 changes: 4 additions & 4 deletions dagger/pipeline/tasks/dbt_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def init_attributes(cls, orig_cls):
comment="Which directory to look in for the profiles.yml file",
),
Attribute(
attribute_name="profile_name",
attribute_name="target_name",
required=False,
parent_fields=["task_parameters"],
comment="Which target to load for the given profile "
Expand All @@ -45,7 +45,7 @@ def __init__(self, name, pipeline_name, pipeline, job_config):

self._project_dir = self.parse_attribute("project_dir")
self._profile_dir = self.parse_attribute("profile_dir")
self._profile_name = self.parse_attribute("profile_name") or "default"
self._target_name = self.parse_attribute("target_name") or "default"
self._select = self.parse_attribute("select")
self._dbt_command = self.parse_attribute("dbt_command")

Expand All @@ -58,8 +58,8 @@ def profile_dir(self):
return self._profile_dir

@property
def profile_name(self):
return self._profile_name
def target_name(self):
return self._target_name

@property
def select(self):
Expand Down
2 changes: 1 addition & 1 deletion dockers/airflow/airflow.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ backend =
# The backend_kwargs param is loaded into a dictionary and passed to __init__ of secrets backend class.
# See documentation for the secrets backend you are using. JSON is expected.
# Example for AWS Systems Manager ParameterStore:
# ``{{"connections_prefix": "/airflow/connections", "profile_name": "default"}}``
# ``{{"connections_prefix": "/airflow/connections", "target_name": "default"}}``
backend_kwargs =

[cli]
Expand Down

0 comments on commit 52e7572

Please sign in to comment.