Skip to content

Conversation

@GabeInDevOps
Copy link
Contributor

attempt at resolving issue #8920

@vercel
Copy link

vercel bot commented Nov 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

8 Skipped Deployments
Name Status Preview Comments Updated (UTC)
examples-angular-dashboard ⬜️ Ignored (Inspect) Visit Preview Nov 8, 2024 4:14pm
examples-react-d3 ⬜️ Ignored (Inspect) Visit Preview Nov 8, 2024 4:14pm
examples-react-dashboard ⬜️ Ignored (Inspect) Visit Preview Nov 8, 2024 4:14pm
examples-react-data-table ⬜️ Ignored (Inspect) Visit Preview Nov 8, 2024 4:14pm
examples-react-highcharts ⬜️ Ignored (Inspect) Visit Preview Nov 8, 2024 4:14pm
examples-react-material-ui ⬜️ Ignored (Inspect) Visit Preview Nov 8, 2024 4:14pm
examples-react-pivot-table ⬜️ Ignored (Inspect) Visit Preview Nov 8, 2024 4:14pm
examples-vue-query-builder ⬜️ Ignored (Inspect) Visit Preview Nov 8, 2024 4:14pm

@github-actions github-actions bot added the pr:community Contribution from Cube.js community members. label Nov 8, 2024
@igorlukanin
Copy link
Member

@GabeInDevOps Thanks for the contribution! Before it's merged, we'll need an update to docs (both for the env var reference page and the DuckDb page). Thank you in advance!

Comment on lines +1621 to +1623
process.env[
keyByDataSource('CUBEJS_DB_DUCKDB_S3_USE_CREDENTIAL_CHAIN', dataSource)
]
Copy link
Member

Choose a reason for hiding this comment

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

It would be better to parse and return a boolean here. This will simplify further checks. Have a look at this example:

  snowflakeSessionKeepAlive: ({
    dataSource
  }: {
    dataSource: string,
  }) => {
    const val = process.env[
      keyByDataSource(
        'CUBEJS_DB_SNOWFLAKE_CLIENT_SESSION_KEEP_ALIVE',
        dataSource,
      )
    ];
    if (val) {
      if (val.toLocaleLowerCase() === 'true') {
        return true;
      } else if (val.toLowerCase() === 'false') {
        return false;
      } else {
        throw new TypeError(
          `The ${
            keyByDataSource(
              'CUBEJS_DB_SNOWFLAKE_CLIENT_SESSION_KEEP_ALIVE',
              dataSource,
            )
          } must be either 'true' or 'false'.`
        );
      }
    } else {
      return true;
    }
  },

This way, you can also control the default value if the env var is not set.

@KSDaemon
Copy link
Member

Gentle ping @GabeInDevOps. Could you please rebase on top of the latest master and wdyt about suggested changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data source driver pr:community Contribution from Cube.js community members.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants