MeltanoLabs / tap-google-analytics

Singer.io Tap for extracting data from the Google Analytics Reporting API
Apache License 2.0
11 stars 20 forks source link

fix: Invalid key error for metric_filter and dimension_filter #187

Closed pedroceriotti closed 5 months ago

pedroceriotti commented 5 months ago

This PR fixes the issue introduced by #186.

It was causing the tap to break if no metric filter or dimensions are defined in the reports.json, or if these keys are defined with camelCase notation, which would be reasonable given it's a JSON file and all the other dimension and metric values use camelCase notation.

The issue was that the keys were defined with camelCase on lines 113-114 on the client.py file when initializing the report_definition dictionary, but it then tries to access them using _snakecase notation on lines 267-268, which caused the tap to break with an invalid key error.

sonarcloud[bot] commented 5 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud