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

Fix csv snippet error #11503

Merged
merged 1 commit into from
Mar 20, 2025
Merged

Fix csv snippet error #11503

merged 1 commit into from
Mar 20, 2025

Conversation

PopDaph
Copy link
Contributor

@PopDaph PopDaph commented Mar 20, 2025

Description

New attempt at fixing this error: Log.

The error occurred because the output of the table query action is:

{
  thinking: "Some thinking",
  query: "The query",
  query_title: "The query title",
  results: [
    {
      'GROUP_CONCAT(DISTINCT "owner")': null,
    },
  ],
}

The fact that the value is null somehow breaks the snippet generation.
I fixed it by keeping the empty line.
Tested locally and now the snippet looks like this:

TOTAL_LINES: 1
"GROUP_CONCAT(DISTINCT ""owner"")"


(end of file)

This means that for an output as is:

{
  thinking: "Some thinking",
  query: "The query",
  query_title: "The query title",
  results: results: [
      {
        DS: "20161",
      },
      {
        DS: "20160",
      },
      {
        DS: "20159",
      },
      {
        DS: null,
      },
      {
        DS: "20157",
      },
    ],
}

Instead of getting:

TOTAL_LINES: 5
DS
20161
20160
20159
20157

(1 lines omitted)

We will get:

TOTAL_LINES: 5
DS
20161
20160
20159

20157

(end of file)

Tests

Locally.

Risk

I'm not sure why we were skipping empty lines and I think it's fine to keep them but I'll confirm with Seb who wrote the code + this is safe to rollback.

Deploy Plan

Deploy front.

@PopDaph PopDaph requested review from Fraggle and tdraier March 20, 2025 14:24
@PopDaph PopDaph merged commit cba6d10 into main Mar 20, 2025
6 checks passed
@PopDaph PopDaph deleted the fix-csv-snippet-error-3 branch March 20, 2025 15:29
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 this pull request may close these issues.

2 participants