Skip to content
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

Date foreign key references produce duplicates in filter and group by dialogs #15563

Closed
notrom opened this issue Apr 12, 2021 · 3 comments
Closed
Assignees
Labels
.Frontend Priority:P2 Average run of the mill bug Querying/GUI Query builder catch-all, including simple mode Querying/Remapping Remapped display values, whether human-readable values or Field->Field remappings .Regression Bugs that were previously fixed and/or bugs unintentionally shipped with new features. .Reproduced Issues reproduced in test (usually Cypress) Type:Bug Product defects

Comments

@notrom
Copy link

notrom commented Apr 12, 2021

Describe the bug
Joins defined in the data model using a datetime as the key are giving duplicated rows in filter and group by menus.

We have date fields in our data that we use as a foreign key to a date table, primary key is a date. We model this in the Metabase data model. Previously this has work well for us but I've just upgraded a test instance to v0.39.0-rc1 and now we're seeing some strange behaviour in the UI with multiple duplicate fields being displayed.

The resulting summary is correct for each month and the generated query seems to be correct as I'd expect.

Logs
Nothing of interest

To Reproduce

  1. In Metabase data model, Sample dataset, change Orders > Created At to be the entity key
  2. Change Reviews > Created At to be a foreign key referencing the 'Orders > Created At'
  3. Make a new question for Reviews
  4. Summarize, now note that "Created At" is repeated multiple times
  5. Filter, same thing repeated.

Expected behavior
Dates should be able to be used as primary and foreign keys without causing UI issues.

Screenshots
These are from our data, not Sample Dataset.

In v0.38.1 the group by options for these fields looks like this:
image

Now in v0.39.0-rc1 it looks like this:
image

When selecting any one of these repeats they all get highlighted
image

Information about your Metabase Installation:

{
  "browser-info": {
    "language": "en-NZ",
    "platform": "Win32",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36",
    "vendor": "Google Inc."
  },
  "system-info": {
    "file.encoding": "Cp1252",
    "java.runtime.name": "OpenJDK Runtime Environment",
    "java.runtime.version": "13.0.2+8",
    "java.vendor": "Oracle Corporation",
    "java.vendor.url": "https://java.oracle.com/",
    "java.version": "13.0.2",
    "java.vm.name": "OpenJDK 64-Bit Server VM",
    "java.vm.version": "13.0.2+8",
    "os.name": "Windows 10",
    "os.version": "10.0",
    "user.language": "en",
    "user.timezone": "Pacific/Auckland"
  },
  "metabase-info": {
    "databases": [
      "sqlserver",
      "h2"
    ],
    "hosting-env": "unknown",
    "application-database": "postgres",
    "application-database-details": {
      "database": {
        "name": "PostgreSQL",
        "version": "12.1"
      },
      "jdbc-driver": {
        "name": "PostgreSQL JDBC Driver",
        "version": "42.2.18"
      }
    },
    "run-mode": "prod",
    "version": {
      "date": "2021-04-06",
      "tag": "v0.39.0-rc1",
      "branch": "release-x.39.x",
      "hash": "471eda1"
    },
    "settings": {
      "report-timezone": "UTC"
    }
  }
}

Severity
Makes the grouping and filtering dialogs harder to use, more importantly it just looks wrong. Functionality still works fine.

Additional context
Other relationships seems to be fine, it's just dates that are causing this.

@notrom notrom added .Needs Triage Type:Bug Product defects labels Apr 12, 2021
@flamber flamber added .Regression Bugs that were previously fixed and/or bugs unintentionally shipped with new features. Priority:P2 Average run of the mill bug Querying/GUI Query builder catch-all, including simple mode .Frontend and removed .Needs Triage labels Apr 12, 2021
@flamber
Copy link
Contributor

flamber commented Apr 12, 2021

Related to #15446 and #15574, since the duplicated fields are actually belonging to Reviews - tested commit efebdad
image

@ariya
Copy link
Contributor

ariya commented Apr 13, 2021

Looks like this is also fixed by PR #15582 (already merged to release-x.39.x branch).

@flamber
Copy link
Contributor

flamber commented Apr 13, 2021

@ariya 👍 fixed by #15582
image

@flamber flamber closed this as completed Apr 13, 2021
@flamber flamber assigned ariya and unassigned dpsutton Apr 13, 2021
@rlotun rlotun moved this from Blockers for 39 to Closed Issues and PRs in 39 and 38.x Planning Board Apr 13, 2021
nemanjaglumac added a commit that referenced this issue Apr 14, 2021
nemanjaglumac added a commit that referenced this issue Apr 14, 2021
…apped (#15592)

* Add repro for #15563

* Fix "post-join filters" flake

* Unskip the test (fixed by #15582)

* Use explicit assertion
@nemanjaglumac nemanjaglumac added the .Reproduced Issues reproduced in test (usually Cypress) label Apr 14, 2021
@camsaul camsaul added the Querying/Remapping Remapped display values, whether human-readable values or Field->Field remappings label Jan 21, 2022
@replay-io replay-io bot mentioned this issue Apr 24, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.Frontend Priority:P2 Average run of the mill bug Querying/GUI Query builder catch-all, including simple mode Querying/Remapping Remapped display values, whether human-readable values or Field->Field remappings .Regression Bugs that were previously fixed and/or bugs unintentionally shipped with new features. .Reproduced Issues reproduced in test (usually Cypress) Type:Bug Product defects
Projects
39 and 38.x Planning Board
Closed Issues and PRs
Development

No branches or pull requests

6 participants