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 2022/06/21 13:27:45 UTC
[GitHub] [superset] dmelo opened a new pull request, #20456: fix: handle tstzrange PostgreSQL column type
dmelo opened a new pull request, #20456:
URL: https://github.com/apache/superset/pull/20456
<!---
Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
Example:
fix(dashboard): load charts correctly
-->
### SUMMARY
<!--- Describe the change below, including rationale and design decisions -->
Addresses the issue #19995 .
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

### TESTING INSTRUCTIONS
<!--- Required! What steps can be taken to manually verify the changes? -->
Use Superset to connect to a PostgreSQL database with a column of type `tstzrange`. Then, on "SQL Lab" -> "SQL Editor" try to query the database on data from the table that has the `tstzrange` column type.
The bug shows the error message stating it is unable to serialize the data. This PR creates a representation for that column type.
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [X] Has associated issue: #19995
- [ ] Required feature flags:
- [ ] 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
Re: [PR] fix: handle tstzrange PostgreSQL column type [superset]
Posted by "dmelo (via GitHub)" <gi...@apache.org>.
dmelo closed pull request #20456: fix: handle tstzrange PostgreSQL column type
URL: https://github.com/apache/superset/pull/20456
--
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] john-bodley commented on a diff in pull request #20456: fix: handle tstzrange PostgreSQL column type
Posted by GitBox <gi...@apache.org>.
john-bodley commented on code in PR #20456:
URL: https://github.com/apache/superset/pull/20456#discussion_r902796677
##########
superset/utils/core.py:
##########
@@ -580,6 +581,10 @@ def json_iso_dttm_ser(obj: Any, pessimistic: bool = False) -> str:
return val
if isinstance(obj, (datetime, date, pd.Timestamp)):
obj = obj.isoformat()
+ elif isinstance(obj, psycopg2._range.DateTimeTZRange):
Review Comment:
Thanks for the fix, however database specific encoding should be handled by the associated DB engine spec. I _think_ the solution would be to move `json_iso_dttm_ser` to `db_engine_specs/base.py` and override it for PostgreSQL.
--
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
Re: [PR] fix: handle tstzrange PostgreSQL column type [superset]
Posted by "dmelo (via GitHub)" <gi...@apache.org>.
dmelo commented on PR #20456:
URL: https://github.com/apache/superset/pull/20456#issuecomment-2049539990
Closing this PR, as it seems to have been superseded by https://github.com/apache/superset/pull/23865 . More details on the issue https://github.com/apache/superset/issues/19995
--
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
Re: [PR] fix: handle tstzrange PostgreSQL column type [superset]
Posted by "dmelo (via GitHub)" <gi...@apache.org>.
dmelo commented on PR #20456:
URL: https://github.com/apache/superset/pull/20456#issuecomment-1943562880
@rusackas , yes. I'll go over the PR. But I think I'll need a few more days.
--
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
Re: [PR] fix: handle tstzrange PostgreSQL column type [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on PR #20456:
URL: https://github.com/apache/superset/pull/20456#issuecomment-1920534607
@dmelo @john-bodley do either of you want to follow up on patching this PR to get it in and close the issue? I assume the issue is still valid in current Superset, but I'm not sure.
--
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 #20456: fix: handle tstzrange PostgreSQL column type
Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on PR #20456:
URL: https://github.com/apache/superset/pull/20456#issuecomment-1161837491
# [Codecov](https://codecov.io/gh/apache/superset/pull/20456?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 [#20456](https://codecov.io/gh/apache/superset/pull/20456?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (5b58668) into [master](https://codecov.io/gh/apache/superset/commit/1ae935379fa8f1f5043205f218d7c1af93fae053?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (1ae9353) will **decrease** coverage by `0.17%`.
> The diff coverage is `58.33%`.
> :exclamation: Current head 5b58668 differs from pull request most recent head 7365192. Consider uploading reports for the commit 7365192 to get more accurate results
```diff
@@ Coverage Diff @@
## master #20456 +/- ##
==========================================
- Coverage 54.96% 54.78% -0.18%
==========================================
Files 1739 1739
Lines 65104 65116 +12
Branches 6895 6896 +1
==========================================
- Hits 35782 35672 -110
- Misses 27573 27695 +122
Partials 1749 1749
```
| Flag | Coverage Δ | |
|---|---|---|
| hive | `?` | |
| presto | `53.59% <41.66%> (-0.01%)` | :arrow_down: |
| python | `58.01% <58.33%> (-0.38%)` | :arrow_down: |
| unit | `50.57% <58.33%> (+<0.01%)` | :arrow_up: |
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/20456?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [superset/db\_engine\_specs/bigquery.py](https://codecov.io/gh/apache/superset/pull/20456/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-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2JpZ3F1ZXJ5LnB5) | `52.12% <ø> (ø)` | |
| [superset/superset\_typing.py](https://codecov.io/gh/apache/superset/pull/20456/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-c3VwZXJzZXQvc3VwZXJzZXRfdHlwaW5nLnB5) | `98.11% <ø> (ø)` | |
| [superset/utils/core.py](https://codecov.io/gh/apache/superset/pull/20456/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-c3VwZXJzZXQvdXRpbHMvY29yZS5weQ==) | `62.98% <20.00%> (-0.37%)` | :arrow_down: |
| [superset/result\_set.py](https://codecov.io/gh/apache/superset/pull/20456/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-c3VwZXJzZXQvcmVzdWx0X3NldC5weQ==) | `76.69% <85.71%> (-2.05%)` | :arrow_down: |
| [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/20456/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%> (-85.19%)` | :arrow_down: |
| [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/20456/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=) | `35.49% <0.00%> (-28.63%)` | :arrow_down: |
| [superset/connectors/sqla/utils.py](https://codecov.io/gh/apache/superset/pull/20456/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-c3VwZXJzZXQvY29ubmVjdG9ycy9zcWxhL3V0aWxzLnB5) | `77.27% <0.00%> (-3.41%)` | :arrow_down: |
| [superset/db\_engine\_specs/base.py](https://codecov.io/gh/apache/superset/pull/20456/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-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2Jhc2UucHk=) | `72.66% <0.00%> (-1.17%)` | :arrow_down: |
| [superset/connectors/sqla/models.py](https://codecov.io/gh/apache/superset/pull/20456/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==) | `76.96% <0.00%> (-0.45%)` | :arrow_down: |
| ... and [2 more](https://codecov.io/gh/apache/superset/pull/20456/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/20456?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/20456?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 [1ae9353...7365192](https://codecov.io/gh/apache/superset/pull/20456?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