You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/08/10 00:52:56 UTC
[GitHub] [superset] eschutho opened a new pull request #16160: change query predicate to text
eschutho opened a new pull request #16160:
URL: https://github.com/apache/superset/pull/16160
### SUMMARY
<!--- Describe the change below, including rationale and design decisions -->
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
<!--- Skip this if not applicable -->
### TESTING INSTRUCTIONS
<!--- Required! What steps can be taken to manually verify the changes? -->
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [ ] Has associated issue:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] michael-s-molina commented on a change in pull request #16160: feat: change query predicate to text
Posted by GitBox <gi...@apache.org>.
michael-s-molina commented on a change in pull request #16160:
URL: https://github.com/apache/superset/pull/16160#discussion_r686033458
##########
File path: superset-frontend/src/datasource/DatasourceEditor.jsx
##########
@@ -616,7 +616,12 @@ class DatasourceEditor extends React.PureComponent {
'values from the table. Typically the intent would be to limit the scan ' +
'by applying a relative time filter on a partitioned or indexed time-related field.',
)}
- control={<TextControl controlId="fetch_values_predicate" />}
+ control={
+ <TextAreaControl
+ language="sql"
+ controlId="fetch_values_predicate"
+ />
Review comment:
```suggestion
<TextAreaControl
language="sql"
controlId="fetch_values_predicate"
minLines={5}
maxLines={20}
/>
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] eschutho commented on a change in pull request #16160: feat: change query predicate to text
Posted by GitBox <gi...@apache.org>.
eschutho commented on a change in pull request #16160:
URL: https://github.com/apache/superset/pull/16160#discussion_r686196690
##########
File path: superset-frontend/src/datasource/DatasourceEditor.jsx
##########
@@ -616,7 +616,12 @@ class DatasourceEditor extends React.PureComponent {
'values from the table. Typically the intent would be to limit the scan ' +
'by applying a relative time filter on a partitioned or indexed time-related field.',
)}
- control={<TextControl controlId="fetch_values_predicate" />}
+ control={
+ <TextAreaControl
+ language="sql"
+ controlId="fetch_values_predicate"
+ />
Review comment:
that's looks much better.. thanks @michael-s-molina!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] github-actions[bot] commented on pull request #16160: feat: change query predicate to text
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #16160:
URL: https://github.com/apache/superset/pull/16160#issuecomment-896131187
⚠️ @eschutho Your base branch `master` has just also updated `superset/migrations`.
❗ **Please consider rebasing your branch to avoid db migration conflicts.**
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] betodealmeida commented on a change in pull request #16160: feat: change query predicate to text
Posted by GitBox <gi...@apache.org>.
betodealmeida commented on a change in pull request #16160:
URL: https://github.com/apache/superset/pull/16160#discussion_r686322457
##########
File path: .pylintrc
##########
@@ -251,7 +251,7 @@ expected-line-ending-format=
# Logging modules to check that the string format arguments are in logging
# function parameter format
logging-modules=logging
-
+disable=logging-fstring-interpolation
Review comment:
```suggestion
```
Using f-strings with logging is not considered safe because if the string interpolation fails nothing gets logged. if you use the old-school string interpolation then the message always get logged, even if the impersonation fails.
##########
File path: superset/migrations/versions/07071313dd52_change_fetch_values_predicate_to_text.py
##########
@@ -0,0 +1,84 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""change_fetch_values_predicate_to_text
+
+Revision ID: 07071313dd52
+Revises: 6d20ba9ecb33
+Create Date: 2021-08-09 17:32:56.204184
+
+"""
+
+# revision identifiers, used by Alembic.
+revision = "07071313dd52"
+down_revision = "6d20ba9ecb33"
+
+import logging
+
+import sqlalchemy as sa
+from alembic import op
+from sqlalchemy import and_, func, or_
+from sqlalchemy.dialects import postgresql
+from sqlalchemy.sql.schema import Table
+
+from superset import db
+from superset.connectors.sqla.models import SqlaTable
+
+
+def upgrade():
+ with op.batch_alter_table("tables") as batch_op:
+ batch_op.alter_column(
+ "fetch_values_predicate",
+ existing_type=sa.String(length=1000),
+ type_=sa.Text(),
+ existing_nullable=True,
+ )
+
+
+def remove_value_if_too_long():
+ bind = op.get_bind()
+ session = db.Session(bind=bind)
+
+ # it will be easier for users to notice that their field has been deleted rather than truncated
+ # so just remove it if it won't fit back into the 1000 string length column
+ try:
+ rows = (
+ session.query(SqlaTable)
+ .filter(func.length(SqlaTable.fetch_values_predicate) > 1000)
+ .all()
+ )
+
+ for row in rows:
+ row.fetch_values_predicate = None
+
+ logging.info(f"{len(rows)} values deleted")
Review comment:
```suggestion
logging.info("%d values deleted", len(rows))
```
##########
File path: .pylintrc
##########
@@ -251,7 +251,7 @@ expected-line-ending-format=
# Logging modules to check that the string format arguments are in logging
# function parameter format
logging-modules=logging
-
+disable=logging-fstring-interpolation
Review comment:
```suggestion
```
Using f-strings with logging is not considered safe because if the string interpolation fails nothing gets logged. if you use the old-school string interpolation then the message always get logged, even if the interpolation fails.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] michael-s-molina commented on a change in pull request #16160: feat: change query predicate to text
Posted by GitBox <gi...@apache.org>.
michael-s-molina commented on a change in pull request #16160:
URL: https://github.com/apache/superset/pull/16160#discussion_r686033458
##########
File path: superset-frontend/src/datasource/DatasourceEditor.jsx
##########
@@ -616,7 +616,12 @@ class DatasourceEditor extends React.PureComponent {
'values from the table. Typically the intent would be to limit the scan ' +
'by applying a relative time filter on a partitioned or indexed time-related field.',
)}
- control={<TextControl controlId="fetch_values_predicate" />}
+ control={
+ <TextAreaControl
+ language="sql"
+ controlId="fetch_values_predicate"
+ />
Review comment:
```suggestion
<TextAreaControl
language="sql"
controlId="fetch_values_predicate"
minLines={5}
/>
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] codecov[bot] commented on pull request #16160: feat: change query predicate to text
Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on pull request #16160:
URL: https://github.com/apache/superset/pull/16160#issuecomment-895653278
# [Codecov](https://codecov.io/gh/apache/superset/pull/16160?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#16160](https://codecov.io/gh/apache/superset/pull/16160?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (1944a03) into [master](https://codecov.io/gh/apache/superset/commit/606a7bf429edf28c410ee57aff1b5cbb062bd88f?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (606a7bf) will **decrease** coverage by `0.26%`.
> The diff coverage is `100.00%`.
[](https://codecov.io/gh/apache/superset/pull/16160?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #16160 +/- ##
==========================================
- Coverage 76.82% 76.55% -0.27%
==========================================
Files 996 996
Lines 52940 52940
Branches 6732 6732
==========================================
- Hits 40670 40529 -141
- Misses 12045 12186 +141
Partials 225 225
```
| Flag | Coverage Δ | |
|---|---|---|
| hive | `?` | |
| mysql | `?` | |
| postgres | `81.54% <100.00%> (-0.05%)` | :arrow_down: |
| presto | `?` | |
| python | `81.59% <100.00%> (-0.52%)` | :arrow_down: |
| sqlite | `81.19% <100.00%> (ø)` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/superset/pull/16160?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...erset-frontend/src/datasource/DatasourceEditor.jsx](https://codecov.io/gh/apache/superset/pull/16160/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2RhdGFzb3VyY2UvRGF0YXNvdXJjZUVkaXRvci5qc3g=) | `74.25% <100.00%> (ø)` | |
| [superset/connectors/sqla/models.py](https://codecov.io/gh/apache/superset/pull/16160/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29ubmVjdG9ycy9zcWxhL21vZGVscy5weQ==) | `88.08% <100.00%> (-1.67%)` | :arrow_down: |
| [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/16160/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-82.15%)` | :arrow_down: |
| [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/16160/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `69.80% <0.00%> (-16.87%)` | :arrow_down: |
| [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/16160/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `83.47% <0.00%> (-6.91%)` | :arrow_down: |
| [superset/db\_engine\_specs/mysql.py](https://codecov.io/gh/apache/superset/pull/16160/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL215c3FsLnB5) | `94.04% <0.00%> (-3.58%)` | :arrow_down: |
| [superset/utils/date\_parser.py](https://codecov.io/gh/apache/superset/pull/16160/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdXRpbHMvZGF0ZV9wYXJzZXIucHk=) | `93.13% <0.00%> (-3.44%)` | :arrow_down: |
| [superset/common/query\_context.py](https://codecov.io/gh/apache/superset/pull/16160/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvY29tbW9uL3F1ZXJ5X2NvbnRleHQucHk=) | `88.88% <0.00%> (-1.86%)` | :arrow_down: |
| [superset/views/database/mixins.py](https://codecov.io/gh/apache/superset/pull/16160/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `81.03% <0.00%> (-1.73%)` | :arrow_down: |
| ... and [5 more](https://codecov.io/gh/apache/superset/pull/16160/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/16160?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/16160?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [606a7bf...1944a03](https://codecov.io/gh/apache/superset/pull/16160?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] betodealmeida merged pull request #16160: feat: change query predicate to text
Posted by GitBox <gi...@apache.org>.
betodealmeida merged pull request #16160:
URL: https://github.com/apache/superset/pull/16160
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org