luciano_pinto
07/31/2020, 4:03 AMDownload the client_secrets.json file for your service account, and place it on the machine wherewill be executed.target-bigquery
Set aI don't know how to create this environment variable nor understood how to modify meltano.yml to add credentials (and also dataset and table specs). Any tips or tutorials on how to make it work?environment variable on the machine, where the value is the fully qualified path to client_secrets.jsonGOOGLE_APPLICATION_CREDENTIALS
keat
07/31/2020, 5:18 AMmeltano.yml like the screenshot, then add the value of the env var in .env to add
export GOOGLE_APPLICATION_CREDENTIALS = 'path/to/secrets.json'
to check if you are doing it correctly, you can do meltano config <plugin> list to see if GOOGLE_APPLICATION_CREDENTIALS is loaded properlydouwe_maan
07/31/2020, 2:12 PMtarget-bigquery to your project, you'll have a section in your meltano.yml like the one @keat shared.
You can then use meltano config target-bigquery list to view the available settings and their current values, and you can use meltano config target-bigquery set <setting> <value> to store a value in meltano.yml . If you'd like to store certain config in the environment instead (so that it's not checked into version control, if you plan to use that), you can use .env (as Keat suggested) or the native environment variable functionality provided by your shell or orchestration environment.
See also https://meltano.slack.com/archives/CFG3C3C66/p1594667270109000?thread_ts=1594434709.063300&cid=CFG3C3C66 🙂luciano_pinto
08/01/2020, 6:33 PMTypeError: Object of type Decimal is not JSON serializable
INFO Refreshing access_token
INFO Syncing stream: website_overview
INFO URL being requested: POST <https://analyticsreporting.googleapis.com/v4/reports:batchGet?alt=json>
INFO Syncing stream: traffic_sources
INFO URL being requested: POST <https://analyticsreporting.googleapis.com/v4/reports:batchGet?alt=json>
Traceback (most recent call last):
File "/Users/L/meltano-projects/ga-enc-project/.meltano/loaders/target-google-bigquery/venv/bin/target-google-bigquery", line 11, in <module>
load_entry_point('target-bigquery==1.4.0', 'console_scripts', 'target-bigquery')()
File "/Users/L/meltano-projects/ga-enc-project/.meltano/loaders/target-google-bigquery/venv/lib/python3.7/site-packages/target_bigquery.py", line 306, in main
state = persist_lines_stream(config['project_id'], config['dataset_id'], input, validate_records=validate_records)
File "/Users/L/meltano-projects/ga-enc-project/.meltano/loaders/target-google-bigquery/venv/lib/python3.7/site-packages/target_bigquery.py", line 231, in persist_lines_stream
errors[msg.stream] = bigquery_client.insert_rows_json(tables[msg.stream], [msg.record])
File "/Users/L/meltano-projects/ga-enc-project/.meltano/loaders/target-google-bigquery/venv/lib/python3.7/site-packages/google/cloud/bigquery/client.py", line 2678, in insert_rows_json
timeout=timeout,
File "/Users/L/meltano-projects/ga-enc-project/.meltano/loaders/target-google-bigquery/venv/lib/python3.7/site-packages/google/cloud/bigquery/client.py", line 574, in _call_api
return call()
File "/Users/L/meltano-projects/ga-enc-project/.meltano/loaders/target-google-bigquery/venv/lib/python3.7/site-packages/google/api_core/retry.py", line 286, in retry_wrapped_func
on_error=on_error,
File "/Users/L/meltano-projects/ga-enc-project/.meltano/loaders/target-google-bigquery/venv/lib/python3.7/site-packages/google/api_core/retry.py", line 184, in retry_target
return target()
File "/Users/L/meltano-projects/ga-enc-project/.meltano/loaders/target-google-bigquery/venv/lib/python3.7/site-packages/google/cloud/_http.py", line 409, in api_request
data = json.dumps(data)
File "/Users/L/anaconda3/lib/python3.7/json/__init__.py", line 231, in dumps
return _default_encoder.encode(obj)
File "/Users/L/anaconda3/lib/python3.7/json/encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/Users/L/anaconda3/lib/python3.7/json/encoder.py", line 257, in iterencode
return _iterencode(o, 0)
File "/Users/L/anaconda3/lib/python3.7/json/encoder.py", line 179, in default
raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type Decimal is not JSON serializabledouwe_maan
08/03/2020, 4:11 PMtarget-google-bigquery is not prepared to handle. What tap are you using?douwe_maan
08/03/2020, 4:12 PMluciano_pinto
08/03/2020, 4:12 PMdouwe_maan
08/03/2020, 4:16 PM.meltano/loaders/target-google-bigquery/venv/lib/python3.7/site-packages/target_bigquery.py and putting a try/except TypeError block around the insert_rows_json call on line 231, so that we can put a breakpoint() there and find out why msg.record contains a Decimal value?douwe_maan
08/03/2020, 4:19 PMmeltano elt may not actually allow you to interact with the debugger running inside the loader processdouwe_maan
08/03/2020, 4:22 PMschema extra on the extractor (https://meltano.com/docs/command-line-interface.html#extractor-extra-schema) to tell the loader to interpret that field as a float instead, assuming it’s currently being told to interpret it as a decimalluciano_pinto
08/03/2020, 4:22 PMdouwe_maan
08/03/2020, 4:26 PMluciano_pinto
08/04/2020, 12:18 PMluciano_pinto
08/04/2020, 1:47 PMReceived state is invalid, incremental state has not been updated
All over the code state is set to Nonedouwe_maan
08/04/2020, 3:50 PMlogging.error(str(err), exc_info=True) above that logging.warning call? Relative to your virtual environment, the file should be at lib/python3.7/site-packages/meltano/core/runner/singer.pyluciano_pinto
08/08/2020, 10:23 PMluciano_pinto
08/10/2020, 3:25 AMdouwe_maan
08/11/2020, 4:08 PMReceived state is invalid, incremental state has not been updated errors, did you try logging the state messages as suggested in https://meltano.slack.com/archives/CFG3C3C66/p1596556214389700?thread_ts=1596168228.349000&cid=CFG3C3C66?
If you're on the latest version of Meltano, you can also use debug mode to log all messages coming out of the tap and target: https://meltano.com/docs/command-line-interface.html#debugging
I'm seeing "ERROR" lines in the output you shared, but they appear to log RECORD messages, not the STATE messages that are causing the issue.douwe_maan
08/11/2020, 4:13 PMwhat would you recommend for me to get a clearer understanding of how to properly define inside meltano.yml:
- the reports (I already have the JSON file with dimensions/metrics)
- get schemas for tap-google-analytics (i could not use discovery mode)I assume you've seen https://gitlab.com/meltano/tap-google-analytics/blob/master/tap_google_analytics/defaults/default_report_definition.json? If you have a reports definition JSON file of your own, you can store it anywhere in your project and set tap-google-analytics's
reports setting to the path: meltano config tap-google-analytics set reports path/to/reports.json. That will add reports: path/to/reports.json to your meltano.yml file under tap-google-analytics 's config object.douwe_maan
08/11/2020, 4:15 PMmeltano invoke tap-google-analytics --discover and the features that use it, like meltano select --list --all tap-google-analyticsdouwe_maan
08/11/2020, 4:15 PM