airbyte icon indicating copy to clipboard operation
airbyte copied to clipboard

Source Google Analytics: fix custom report with segments

Open DaiZack opened this issue 1 year ago • 2 comments

What

Describe what the change is solving It helps to add screenshots if it affects the frontend. Solve the segment bug

image

How

Describe the solution Added property for segments, and prompt GA error if segemnts is not configured properly by users.

Recommended reading order

  1. x.java
  2. y.python

🚨 User Impact 🚨

Are there any breaking changes? What is the end result perceived by the user? If yes, please merge this PR with the 🚨🚨 emoji so changelog authors can further highlight this if needed.

Pre-merge Checklist

Expand the relevant checklist and delete the others.

Updating a connector

Community member or Airbyter

  • [ x] Grant edit access to maintainers (instructions)
  • [ x] Secrets in the connector's spec are annotated with airbyte_secret
  • [x ] Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • [ x] Code reviews completed
  • [x ] Documentation updated
    • [x ] Connector's README.md
    • [x ] Connector's bootstrap.md. See description and examples
    • [x ] Changelog updated in docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
  • [ x] PR name follows PR naming conventions

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • [ ] Create a non-forked branch based on this PR and test the below items on it
  • [ ] Build is successful
  • [ ] If new credentials are required for use in CI, add them to GSM. Instructions.
  • [ ] /test connector=connectors/<name> command is passing
  • [ ] New Connector version released on Dockerhub and connector version bumped by running the /publish command described here

DaiZack avatar Feb 01 '23 17:02 DaiZack

update doc for pr id

DaiZack avatar Feb 01 '23 18:02 DaiZack

/test connector=connectors/source-google-analytics-v4

:clock2: connectors/source-google-analytics-v4 https://github.com/airbytehq/airbyte/actions/runs/4072657679 :white_check_mark: connectors/source-google-analytics-v4 https://github.com/airbytehq/airbyte/actions/runs/4072657679 Python tests coverage:

Name                                                     Stmts   Miss  Cover
----------------------------------------------------------------------------
source_google_analytics_v4/__init__.py                       2      0   100%
source_google_analytics_v4/custom_reports_validator.py      51      2    96%
source_google_analytics_v4/source.py                       306     22    93%
----------------------------------------------------------------------------
TOTAL                                                      359     24    93%
	 Name                                                 Stmts   Miss  Cover   Missing
	 ----------------------------------------------------------------------------------
	 source_acceptance_test/base.py                          12      4    67%   16-19
	 source_acceptance_test/config.py                       141      5    96%   87, 93, 239, 243-244
	 source_acceptance_test/conftest.py                     211     95    55%   36, 42-44, 49, 54, 77, 83, 89-91, 110, 115-117, 123-125, 131-132, 137-138, 143, 149, 158-167, 173-178, 193, 217, 248, 254, 262-267, 275-285, 293-306, 311-317, 324-335, 342-358
	 source_acceptance_test/plugin.py                        69     25    64%   22-23, 31, 36, 120-140, 144-148
	 source_acceptance_test/tests/test_core.py              476    117    75%   53, 58, 97-108, 113-120, 124-125, 129-130, 380, 400, 438, 476-493, 506-517, 521-526, 532, 565-570, 608-615, 658-660, 663, 728-736, 748-751, 756, 812-813, 819, 822, 858-868, 881-906
	 source_acceptance_test/tests/test_incremental.py       160     14    91%   58-65, 70-83, 246
	 source_acceptance_test/utils/asserts.py                 39      2    95%   62-63
	 source_acceptance_test/utils/common.py                  94     10    89%   16-17, 32-38, 72, 75
	 source_acceptance_test/utils/compare.py                 62     23    63%   21-51, 68, 97-99
	 source_acceptance_test/utils/connector_runner.py       133     33    75%   24-27, 46-47, 50-54, 57-58, 73-75, 78-80, 83-85, 88-90, 93-95, 124-125, 159-161, 208
	 source_acceptance_test/utils/json_schema_helper.py     114     13    89%   31-32, 39, 42, 66-69, 97, 121, 203-205
	 ----------------------------------------------------------------------------------
	 TOTAL                                                 1690    341    80%

Build Passed

Test summary info:

=========================== short test summary info ============================
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/tests/test_core.py:98: The previous and actual specifications are identical.
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/source_acceptance_test/tests/test_core.py:507: The previous and actual discovered catalogs are identical.
================== 36 passed, 2 skipped in 207.62s (0:03:27) ===================

marcosmarxm avatar Feb 02 '23 08:02 marcosmarxm

/test connector=connectors/source-google-analytics-v4

:clock2: connectors/source-google-analytics-v4 https://github.com/airbytehq/airbyte/actions/runs/4693592081 :white_check_mark: connectors/source-google-analytics-v4 https://github.com/airbytehq/airbyte/actions/runs/4693592081 Python tests coverage:

Name                                                     Stmts   Miss  Cover
----------------------------------------------------------------------------
source_google_analytics_v4/__init__.py                       2      0   100%
source_google_analytics_v4/custom_reports_validator.py      51      2    96%
source_google_analytics_v4/source.py                       306     22    93%
----------------------------------------------------------------------------
TOTAL                                                      359     24    93%

Build Passed

Test summary info:

=========================== short test summary info ============================
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_core.py:578: The previous and actual discovered catalogs are identical.
================== 40 passed, 1 skipped in 1167.18s (0:19:27) ==================

marcosmarxm avatar Apr 13 '23 20:04 marcosmarxm

@archangelic can you add the unit test and make it to the finish line?

marcosmarxm avatar May 25 '23 20:05 marcosmarxm

/test connector=connectors/source-google-analytics-v4

:clock2: connectors/source-google-analytics-v4 https://github.com/airbytehq/airbyte/actions/runs/5112503825 :x: connectors/source-google-analytics-v4 https://github.com/airbytehq/airbyte/actions/runs/5112503825 :bug: https://gradle.com/s/xexiwproauvo4

Build Failed

Test summary info:

=========================== short test summary info ============================
FAILED test_core.py::TestBasicRead::test_read[inputs0] - AssertionError: All ...
FAILED test_full_refresh.py::TestFullRefresh::test_sequential_reads[inputs0]
FAILED test_incremental.py::TestIncremental::test_two_sequential_reads[inputs0]
FAILED test_incremental.py::TestIncremental::test_read_sequential_slices[inputs0]
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_core.py:578: The previous and actual discovered catalogs are identical.
============= 4 failed, 35 passed, 1 skipped in 108.16s (0:01:48) ==============

marcosmarxm avatar May 29 '23 13:05 marcosmarxm

The CI is not working, waiting the fix to release the new version: https://dnsgjos7lj2fu.cloudfront.net/tests/summary/connectors/source-google-analytics-v4/

marcosmarxm avatar May 29 '23 14:05 marcosmarxm

Hi, do you have an idea when this change will be merged? I believe this ensures segments can be used as part of custom reports?

Thanks!

hubertsl avatar Jun 04 '23 22:06 hubertsl

/test connector=connectors/source-google-analytics-v4

:clock2: connectors/source-google-analytics-v4 https://github.com/airbytehq/airbyte/actions/runs/5178413397 :white_check_mark: connectors/source-google-analytics-v4 https://github.com/airbytehq/airbyte/actions/runs/5178413397 Python tests coverage:

Name                                                     Stmts   Miss  Cover
----------------------------------------------------------------------------
source_google_analytics_v4/custom_reports_validator.py      51      0   100%
source_google_analytics_v4/__init__.py                       2      0   100%
source_google_analytics_v4/source.py                       306     22    93%
----------------------------------------------------------------------------
TOTAL                                                      359     22    94%

Build Passed

Test summary info:

=========================== short test summary info ============================
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_core.py:598: The previous and actual discovered catalogs are identical.
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_core.py:695: This tests currently leads to too much failures. We need to fix the connectors at scale first.
================== 39 passed, 2 skipped in 512.72s (0:08:32) ===================

marcosmarxm avatar Jun 05 '23 14:06 marcosmarxm

/test connector=connectors/source-google-analytics-v4

:clock2: connectors/source-google-analytics-v4 https://github.com/airbytehq/airbyte/actions/runs/5242429864 :white_check_mark: connectors/source-google-analytics-v4 https://github.com/airbytehq/airbyte/actions/runs/5242429864 Python tests coverage:

Name                                                     Stmts   Miss  Cover
----------------------------------------------------------------------------
source_google_analytics_v4/__init__.py                       2      0   100%
source_google_analytics_v4/source.py                       306     22    93%
source_google_analytics_v4/custom_reports_validator.py      60      6    90%
----------------------------------------------------------------------------
TOTAL                                                      368     28    92%

Build Passed

Test summary info:

=========================== short test summary info ============================
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_core.py:598: The previous and actual discovered catalogs are identical.
SKIPPED [1] ../usr/local/lib/python3.9/site-packages/connector_acceptance_test/tests/test_core.py:695: This tests currently leads to too much failures. We need to fix the connectors at scale first.
================== 39 passed, 2 skipped in 722.45s (0:12:02) ===================

artem1205 avatar Jun 12 '23 10:06 artem1205

I tried to run integration tests but credentials hit the limit for today.

marcosmarxm avatar Jun 14 '23 19:06 marcosmarxm