For target-bigquery, would it be possible to use t...
# plugins-general
d
For target-bigquery, would it be possible to use the default service account when running in gcp? If I don't specify a Credential path, Meltano throws and exception when it then looks in the default location
$MELTANO_PROJECT_ROOT/client_secrets.json
d
@dan_ladd Good question. If you set the
credentials_path
setting to an empty string (
""
), is that enough to make target-bigquery / google-cloud-bigquery ignore it and fall back on the default?
Copy code
meltano config target-bigquery set credentials_path ""
d
Doesn't seem to fall back unfortunately.
Copy code
meltano | Loading failed (1): google.auth.exceptions.DefaultCredentialsError: File was not found.
d
All right, unfortunately setting
credentials_path: null
in
meltano.yml
won't work either because Meltano will just fall back on the default value. As a workaround for now, I suggest copying the entire plugin definition (https://gitlab.com/meltano/meltano/blob/master/src/meltano/core/bundle/discovery.yml#L1039-1088) into your
meltano.yml
so Meltano will treat it as a custom plugin, and then deleting the default
value
for
credentials_path
. With the optional bits removed:
Copy code
- name: target-bigquery
  namespace: target_bigquery
  variant: adswerve
  pip_url: git+<https://github.com/adswerve/target-bigquery.git@v0.10.2>
  dialect: bigquery
  target_schema: $TARGET_BIGQUERY_DATASET_ID
  settings:
    - name: project_id
    - name: dataset_id
      value: $MELTANO_EXTRACT__LOAD_SCHEMA
    - name: location
      value: US
    - name: credentials_path
      env_aliases: [GOOGLE_APPLICATION_CREDENTIALS]
    - name: validate_records
      kind: boolean
      value: false
    - name: add_metadata_columns
      kind: boolean
      value: false
    - name: replication_method
      kind: options
      options:
        - label: Append
          value: append
        - label: Truncate
          value: truncate
      value: append
    - name: table_prefix
    - name: table_suffix
    - name: max_cache
      value: 50
And to resolve this properly, can you please file an issue about allowing default values to be overridden with
null
in
meltano.yml
? If we support that, the env var wouldn't populated at all with
credentials_path: null
, and we'd have the desired result.
d
Awesome, that worked like a charm. Will open that issue. Thanks as always Douwe!
d
Perfect, thanks!