Skip to content
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

Closed
wants to merge 79 commits into from
Closed

Webhook #29

wants to merge 79 commits into from

Conversation

kaapstorm
Copy link
Contributor

@kaapstorm kaapstorm commented Nov 22, 2023

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 both tasks and views import from utils.

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

hq_superset/views.py Outdated Show resolved Hide resolved

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:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥳

@@ -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)

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?

Copy link
Contributor Author

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. :) )

@kaapstorm
Copy link
Contributor Author

Closing. This branch has been rebased and can be reviewed at PR #41

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants