Skip to content

Commit

Permalink
Handling params the same way as kettle hook. (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
piffall authored Mar 3, 2023
1 parent 0607372 commit c5f6ceb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions airflow_pentaho/hooks/carte.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,13 @@ def run_job(self, job_path, params=None):
'level': self.level
}

if params:
args.update(params)
if params is not None:
for k, val in params.items():
if version.parse(airflow.__version__) >= version.parse('2.2') and \
not isinstance(val, str):
args[k] = val.value
else:
args[k] = val

rs = requests.get(url=url, params=args, auth=self.__get_auth())
if rs.status_code >= 400:
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ setuptools-git-version
pytest
pytest-cov
twine
toml

0 comments on commit c5f6ceb

Please sign in to comment.