-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Webhook #29
Webhook #29
Conversation
1e41803
to
d77b480
Compare
c7404aa
to
52671c9
Compare
`subscribe_to_hq_datasource()` can't be called asynchronously because it needs a web session, so that it can get the OAuth token to authenticate with HQ.
Models use utils. Utils don't use models.
52671c9
to
4aea365
Compare
|
||
Those changes will allow Alembic to connect to the "HD Data" database | ||
without the need to instantiate Superset's Flask app. You can now | ||
autogenerate your new table with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥳
hq_superset/tasks.py
Outdated
@@ -16,34 +13,3 @@ def refresh_hq_datasource_task(domain, datasource_id, display_name, export_path, | |||
AsyncImportHelper(domain, datasource_id).mark_as_complete() | |||
raise | |||
os.remove(export_path) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the commit message:
so that it can get the OAuth token to authenticate with HQ.
Speaking out of inexperience in this area, but can't we simply pass the token to the celery task?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Just closing the loop here. It needs the request session. We could serialize it and pass it to the task, but something about that feels awkward to me. I'm happy to be educated though. :) )
Not necessary for PostgreSQL
* No need to query for tables. * Can't upsert without an index. Creating an index on doc_id might be useful. Do later. * Use a connection off database, otherwise db.session can't find the table.
Also rename some vars, move func def
Closing. This branch has been rebased and can be reviewed at PR #41 |
This is the start on the API endpoint for making changes to datasets.
The first five commits are only cleanup, and a small refactor to move a function into
utils.py
so that bothtasks
andviews
import fromutils
.Create webhook endpoint is the first useful commit. It defines a dataclass for the request payload, and adds the scaffolding for a view for the endpoint.
fyi @Charl1996 @SmittieC