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

Allow backtick for table name #279

Merged

Conversation

olivier-norture
Copy link
Contributor

Hello!

I am using BigQuery with Metabase and when using custom SQL I use backtick "`" for the table name like:

select *
  from `dataset.table_name`

And doing so the depends_on is empty:

    depends_on: []

Here is a full exemple of what I get:

  - name: game_number_of_install
    label: Game number of install
    description: "### Visualization: Bar\n\nNo description provided in Metabase\n\n\
      #### Query\n\n```\nselect  game_title,\n        TIMESTAMP_TRUNC(mixpanel_ce_time,\
      \ MONTH) as Month,\n        count(1) as nb_install\n from `game_activity_marts.game_activity__marts__games_activity`\n\
      where mixpanel_ce_type = \"install_game\"\nAND company_secret = ( usersecret\
      \ )\n[[ AND ( date_Filter ) ]]\n[[ AND (Item_Name) ]]\ngroup by 1, 2\n```\n\n\
      #### Metadata\n\nMetabase ID: __2808__\n\nCreated On: __2024-09-11T15:35:26.612796Z__"
    type: analysis
    url: https://...
    maturity: medium
    owner:
      name: Olivier Norture
      email: ....
    depends_on: []

So I propose to add the backtick in the _EXPOSURE_PARSER regex.
Here is the BigQuery documentation link

I didn't add test because I don't know how to update your metabase test (I only found a db file and nothing that create it); and I'm not sure that Postgres support backtick.

@gouline gouline merged commit e9aa680 into gouline:master Oct 8, 2024
1 check passed
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