-
Notifications
You must be signed in to change notification settings - Fork 0
Add full custom query for observations #39
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -138,6 +138,7 @@ class ObservationFormData: | |
| audience_tables: list[str] | None | ||
| filters: list[str] | None | ||
| custom_test_ids_query: str | None | ||
| full_custom_query: str | None | ||
| metric_tags: list[str] | None | ||
| metric_groups: list[str] | None | ||
|
|
||
|
|
@@ -345,6 +346,9 @@ def render( | |
| "Supports JOINs, CTEs, subqueries, and complex aggregations. " | ||
| "Modifying operations (INSERT, UPDATE, DELETE) are not allowed.", | ||
| ) | ||
| full_custom_query = st.text_area( | ||
| "Full Custom Query", value="", key="full_custom_query_input_key" | ||
| ) | ||
|
Comment on lines
346
to
+351
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The new form field for Useful? React with 👍 / 👎.
Comment on lines
+349
to
+351
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The new text area for Useful? React with 👍 / 👎.
Comment on lines
+349
to
+351
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Useful? React with 👍 / 👎. |
||
|
|
||
| metric_tags: list[str] | None = st.multiselect( | ||
| "Metric Tags", | ||
|
|
@@ -425,6 +429,7 @@ def render( | |
| audience_tables=[t.strip() for t in audience_tables.split("\n") if t.strip()], | ||
| filters=[f.strip() for f in filters.split("\n") if f.strip()], | ||
| custom_test_ids_query=custom_test_ids_query, | ||
| full_custom_query=full_custom_query, | ||
| metric_tags=metric_tags, | ||
| metric_groups=metric_groups, | ||
| ), | ||
|
|
||
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.
The ORM model now defines a
full_custom_querycolumn, but no schema migration accompanies the change. Existing installations will have anobservationstable without this column, so attempts to create or update an observation that includesfull_custom_querywill fail with database errors (e.g. “no such column: observations.full_custom_query”). A migration or other schema update is required to keep the database consistent with the model.Useful? React with 👍 / 👎.