Skip to content

[fix] cluster_name = cluster_name, not cluster_id#8514

Closed
serenajiang wants to merge 1 commit into
apache:masterfrom
serenajiang:serena-fix-cluster-name-id-mismatch
Closed

[fix] cluster_name = cluster_name, not cluster_id#8514
serenajiang wants to merge 1 commit into
apache:masterfrom
serenajiang:serena-fix-cluster-name-id-mismatch

Conversation

@serenajiang
Copy link
Copy Markdown
Contributor

CATEGORY

Choose one

  • Bug Fix
  • Enhancement (new features, refinement)
  • Refactor
  • Add tests
  • Build / Development Environment
  • Documentation

SUMMARY

Found these 3-year-old bugs while looking into some other stuff. I'm guessing this may have happened because of some copy paste errors. It probably isn't too important since they haven't been caught, but it's pretty irksome to look at, so here we go.

TEST PLAN

Passes tox.

REVIEWERS

@john-bodley

Copy link
Copy Markdown
Contributor

@michellethomas michellethomas left a comment

Choose a reason for hiding this comment

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

Weird that they haven't caused issues given that it looks like it's being used in security.py, so you tested and it wasn't working but is now?

@codecov-io
Copy link
Copy Markdown

codecov-io commented Nov 6, 2019

Codecov Report

Merging #8514 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #8514   +/-   ##
=======================================
  Coverage   66.68%   66.68%           
=======================================
  Files         449      449           
  Lines       22684    22684           
  Branches     2366     2366           
=======================================
  Hits        15126    15126           
  Misses       7420     7420           
  Partials      138      138
Impacted Files Coverage Δ
superset/connectors/druid/models.py 82.43% <ø> (ø) ⬆️
superset/connectors/druid/views.py 69.12% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 571c474...aaa030f. Read the comment docs.

return (
session.query(cls)
.filter_by(cluster_name=database.id)
.filter_by(cluster_name=database.database_name)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@michellethomas
This didn't cause any problems for us because we use our own security manager, so this function isn't used.

I did a little more digging, and I'm not entirely certain that cluster_name=database.database_name is correct, since clusters != databases in our tables. Maybe this line should just be removed? Do you know anyone with more context on this kind of thing? Either way, this change won't cause any (more) problems, but it does seem wrong.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe @mistercrunch could chime in here? This code is pretty old

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Mmmh, for reference, this came from #2497.

Clearly there are issues around the Connector interface. Good news is we're planning on deprecating the Druid connector in favor of SQLAlchemy

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This new line is likely to fail as much as the previous line.

@serenajiang serenajiang deleted the serena-fix-cluster-name-id-mismatch branch January 10, 2020 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants