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

Should not use formatting for JSON results downloads #40420

Closed
wooparadog opened this issue Mar 21, 2024 · 3 comments · Fixed by #40606
Closed

Should not use formatting for JSON results downloads #40420

wooparadog opened this issue Mar 21, 2024 · 3 comments · Fixed by #40606
Assignees
Milestone

Comments

@wooparadog
Copy link

Describe the bug

Hi,

When downloading a query result of rows containing numbers or nullable columns, the new version 0.49 will format the data columns.

Example:

header: col1 | col2 | col3
Row1: 1 | "hello" | null

will be formatted as

{
"col1": "1",
"col2": "hello",
"col3": ""
}

which will break down stream processing pipeline.

To Reproduce

  1. Create a table containing various columns types.
  2. Insert dummy data
  3. Download query result as json

Expected behavior

No response

Logs

No response

Information about your Metabase installation

{
  "browser-info": {
    "language": "en-US",
    "platform": "Linux x86_64",
    "userAgent": "Mozilla/5.0 (X11; Linux x86_64; rv:124.0) Gecko/20100101 Firefox/124.0",
    "vendor": ""
  },
  "system-info": {
    "file.encoding": "UTF-8",
    "java.runtime.name": "OpenJDK Runtime Environment",
    "java.runtime.version": "11.0.22+7",
    "java.vendor": "Eclipse Adoptium",
    "java.vendor.url": "https://adoptium.net/",
    "java.version": "11.0.22",
    "java.vm.name": "OpenJDK 64-Bit Server VM",
    "java.vm.version": "11.0.22+7",
    "os.name": "Linux",
    "os.version": "5.10.134-16.1.al8.x86_64",
    "user.language": "en",
    "user.timezone": "PRC"
  },
  "metabase-info": {
    "databases": [
      "postgres"
    ],
    "hosting-env": "unknown",
    "application-database": "postgres",
    "application-database-details": {
      "database": {
        "name": "PostgreSQL",
        "version": "15.5"
      },
      "jdbc-driver": {
        "name": "PostgreSQL JDBC Driver",
        "version": "42.7.2"
      }
    },
    "run-mode": "prod",
    "version": {
      "date": "2024-03-14",
      "tag": "v0.49.0",
      "hash": "46c668b"
    },
    "settings": {
      "report-timezone": null
    }
  }
}

Severity

High

Additional context

And we failed to downgrade..

@paoliniluis
Copy link
Contributor

@wooparadog this was made to make the exports consistent to what you see in the frontend. Why do you want us to give you a format in the browser but then change the format in the export?

@paoliniluis paoliniluis removed Type:Bug Product defects Reporting/Export .Team/DashViz Dashboard and Viz team labels Mar 21, 2024
@adam-james-v
Copy link
Contributor

Yes, @wooparadog a little more information would be helpful for us. I'm wondering these things:

  1. What is your expected output, given your example. Perhaps you could also provide another example or two to further clarify?
  2. Are you doing this via the download results in a dashboard? API? subscription attachment?

This information can help me decide on a good approach to help :)

@wooparadog
Copy link
Author

Sorry..just saw 0.49.3 release notes, and came back to say thanks..

The use case:

Json output is almost always for post processing, like by other programs.
IMO, in this case, the formatting should be handled by the down stream app.

Again, amazing job, and huge thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants