[AIRFLOW-6790] Add basic Tableau Integration#7410
Conversation
7672250 to
7ee25f9
Compare
airflow/providers/salesforce/operators/tableau_refresh_workbook.py
Outdated
Show resolved
Hide resolved
airflow/providers/salesforce/operators/tableau_refresh_workbook.py
Outdated
Show resolved
Hide resolved
airflow/providers/salesforce/operators/tableau_refresh_workbook.py
Outdated
Show resolved
Hide resolved
2a84b4f to
f4ffb15
Compare
|
Ready for another review @eladkal :) |
17e281b to
f76a451
Compare
Codecov Report
@@ Coverage Diff @@
## master #7410 +/- ##
=========================================
- Coverage 86.66% 86.06% -0.6%
=========================================
Files 877 881 +4
Lines 41252 41323 +71
=========================================
- Hits 35751 35565 -186
- Misses 5501 5758 +257
Continue to review full report at Codecov.
|
setup.py
Outdated
There was a problem hiding this comment.
I don't think Salesforce and Tableau are tightly integrated. I would split this into another group.
There was a problem hiding this comment.
Okay. I am fine with this :)
There was a problem hiding this comment.
If I put it into a separate group, does it mean it also belongs to the tableau provider? No, right?
There was a problem hiding this comment.
@Fokko do you think we should move it to a new provider called Tableau?
There was a problem hiding this comment.
Yes, that makes sense to me :)
airflow/providers/salesforce/operators/tableau_refresh_workbook.py
Outdated
Show resolved
Hide resolved
airflow/providers/salesforce/operators/tableau_refresh_workbook.py
Outdated
Show resolved
Hide resolved
airflow/providers/salesforce/operators/tableau_refresh_workbook.py
Outdated
Show resolved
Hide resolved
airflow/providers/salesforce/example_dags/example_tableau_refresh_workbook.py
Outdated
Show resolved
Hide resolved
eladkal
left a comment
There was a problem hiding this comment.
Tested against our Tableau server and it works as expected.
6bd1605 to
7b7082c
Compare
|
@eladkal please take another look. |
airflow/providers/salesforce/example_dags/example_tableau_refresh_workbook.py
Outdated
Show resolved
Hide resolved
7b7082c to
8710e5a
Compare
f05e32a to
54c842c
Compare
- add TableauHook which wraps the tableauserverclient python library in an AirflowHook to connect to a Tableau Server - add TableauRefreshWorkbookOperator which refreshes a Tableau workbook / extract - add TableauJobStatusSensor which pokes the status of a Tableau Job until it has finished
54c842c to
7769a52
Compare
| # The following task queries the status of the workbook refresh job until it succeeds. | ||
| task_check_job_status = TableauJobStatusSensor( | ||
| site_id='my_site', | ||
| job_id="{{ ti.xcom_pull(task_ids='refresh_tableau_workbook') }}", |
There was a problem hiding this comment.
Shouldn't it be refresh_tableau_workbook_non_blocking ?
airflow/providers/salesforce/example_dags/example_tableau_refresh_workbook.py
Outdated
Show resolved
Hide resolved
airflow/providers/salesforce/example_dags/example_tableau_refresh_workbook.py
Outdated
Show resolved
Hide resolved
airflow/providers/salesforce/example_dags/example_tableau_refresh_workbook.py
Outdated
Show resolved
Hide resolved
| :type tableau_conn_id: str | ||
| """ | ||
|
|
||
| def __init__(self, site_id: Optional[str] = None, tableau_conn_id: str = 'tableau_default'): |
There was a problem hiding this comment.
I asked in previous review about the switching the default of site_id from empty string to None. You had a good point that empty string is the default of the pacakge
https://tableau.github.io/server-client-python/docs/api-ref#authentication
Why did you enetualy decided to switch to None?
There was a problem hiding this comment.
|
|
||
| db.merge_conn( | ||
| models.Connection( | ||
| conn_id='tableau_test_password', |
There was a problem hiding this comment.
Why this connection is required? Can't it use the tableau_default that was added to utils/db.py?
airflow/providers/salesforce/example_dags/example_tableau_refresh_workbook.py
Outdated
Show resolved
Hide resolved
airflow/providers/salesforce/example_dags/example_tableau_refresh_workbook.py
Outdated
Show resolved
Hide resolved
airflow/providers/salesforce/example_dags/example_tableau_refresh_workbook.py
Outdated
Show resolved
Hide resolved
airflow/providers/salesforce/example_dags/example_tableau_refresh_workbook.py
Outdated
Show resolved
Hide resolved
|
Good work @feluelle 🎉 |
This PR adds a TableauHook which wraps the tableauserverclient python library in an AirflowHook to connect to a Tableau Server. It also contains a TableauRefreshWorkbookOperator which refreshes a Tableau workbook / extract and a TableauJobStatusSensor which pokes the status of a Tableau Job until it has finished.
Issue link: AIRFLOW-6790
Make sure to mark the boxes below before creating PR: [x]
[AIRFLOW-NNNN]. AIRFLOW-NNNN = JIRA ID** For document-only changes commit message can start with
[AIRFLOW-XXXX].In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.
Read the Pull Request Guidelines for more information.