superset icon indicating copy to clipboard operation
superset copied to clipboard

fix(db-migration): new_dataset_models_take_2 error on postgres

Open micsbot opened this issue 2 years ago • 1 comments

Previous code is not working. It is showing an error because the subquery is making a reference to the same table sl_columns. This code makes explicit the alias and join the tables NewColumn with the subquery. https://github.com/apache/superset/issues/20790

fix(superset db upgrade)

SUMMARY

Previous code is not working. It is showing an error because the subquery is making a reference to the same table sl_columns. This code makes explicit the alias and join the tables NewColumn with the subquery.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

run docker, and exec superset update db using a database with data from superset 1.x.x

ADDITIONAL INFORMATION

  • [ X] Has associated issue: https://github.com/apache/superset/issues/20790

micsbot avatar Sep 09 '22 16:09 micsbot

Codecov Report

Merging #21417 (437e0f4) into master (d3f9fbb) will decrease coverage by 10.84%. The diff coverage is 74.25%.

:exclamation: Current head 437e0f4 differs from pull request most recent head 55e55b9. Consider uploading reports for the commit 55e55b9 to get more accurate results

@@             Coverage Diff             @@
##           master   #21417       +/-   ##
===========================================
- Coverage   66.57%   55.72%   -10.85%     
===========================================
  Files        1791     1835       +44     
  Lines       68593    69970     +1377     
  Branches     7319     7590      +271     
===========================================
- Hits        45665    38990     -6675     
- Misses      21031    29014     +7983     
- Partials     1897     1966       +69     
Flag Coverage Δ
hive 52.60% <ø> (-0.34%) :arrow_down:
mysql ?
postgres ?
presto 52.50% <ø> (-0.34%) :arrow_down:
python 57.81% <ø> (-23.49%) :arrow_down:
sqlite ?
unit 50.90% <ø> (+0.09%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...d/packages/superset-ui-chart-controls/src/index.ts 100.00% <ø> (ø)
...-chart-controls/src/sections/advancedAnalytics.tsx 14.28% <ø> (ø)
...t-controls/src/sections/echartsTimeSeriesQuery.tsx 33.33% <0.00%> (ø)
...i-chart-controls/src/sections/forecastInterval.tsx 100.00% <ø> (ø)
...perset-ui-chart-controls/src/sections/sections.tsx 71.42% <0.00%> (-16.08%) :arrow_down:
...i-chart-controls/src/utils/expandControlConfig.tsx 100.00% <ø> (ø)
.../packages/superset-ui-core/src/chart/types/Base.ts 100.00% <ø> (ø)
...ntend/packages/superset-ui-core/src/color/index.ts 100.00% <ø> (ø)
...superset-ui-core/src/connection/callApi/callApi.ts 100.00% <ø> (ø)
...uperset-ui-core/src/query/types/AnnotationLayer.ts 100.00% <ø> (ø)
... and 707 more

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov[bot] avatar Sep 12 '22 22:09 codecov[bot]

Hey @micsbot thanks for this submission! Can you address the issue with pre-commit and then we can merge!

https://github.com/apache/superset/actions/runs/3023984202/jobs/4897820803

If you're new to pre-commit, I wrote about that here: https://preset.io/blog/tutorial-contributing-code-to-apache-superset/#crafting-a-git-commit

srinify avatar Oct 18 '22 11:10 srinify