Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Source Facebook Marketing: SAT ignored fields in TestFullRefresh.test_sequential_reads #6463

Merged

Conversation

vitaliizazmic
Copy link
Contributor

What

Sometimes records of AdsInsights streams don't contain cost_per_estimated_ad_recallers. It causes test failing.

How

Metric cost_per_estimated_ad_recallers can be calculated based on spend and estimated_ad_recallers. Estimate metric if not presented in records.

Pre-merge Checklist

  • Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • 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.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • Changelog updated in docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
  • PR name follows PR naming conventions
  • Connector version bumped like described here

…llers for AdsInsights streams if not presented in records
@vitaliizazmic vitaliizazmic self-assigned this Sep 27, 2021
@github-actions github-actions bot added the area/connectors Connector related issues label Sep 27, 2021
@vitaliizazmic
Copy link
Contributor Author

vitaliizazmic commented Sep 27, 2021

/test connector=source-facebook-marketing

🕑 source-facebook-marketing https://github.com/airbytehq/airbyte/actions/runs/1279018052
❌ source-facebook-marketing https://github.com/airbytehq/airbyte/actions/runs/1279018052
🐛

@jrhizor jrhizor temporarily deployed to more-secrets September 27, 2021 15:55 Inactive
@CLAassistant
Copy link

CLAassistant commented Sep 27, 2021

CLA assistant check
All committers have signed the CLA.

@vitaliizazmic vitaliizazmic temporarily deployed to more-secrets October 5, 2021 06:46 Inactive
@vitaliizazmic vitaliizazmic changed the title 🐛 Source Facebook Marketing: estimate cost_per_estimated_ad_recallers 🐛 Source Facebook Marketing: SAT ignored fields in TestFullRefresh.test_sequential_reads Oct 5, 2021
@vitaliizazmic
Copy link
Contributor Author

vitaliizazmic commented Oct 5, 2021

/test connector=source-facebook-marketing

🕑 source-facebook-marketing https://github.com/airbytehq/airbyte/actions/runs/1306706075
❌ source-facebook-marketing https://github.com/airbytehq/airbyte/actions/runs/1306706075
🐛 https://gradle.com/s/th4ljflrcymqk

@jrhizor jrhizor temporarily deployed to more-secrets October 5, 2021 06:54 Inactive
@@ -164,3 +164,9 @@ def detailed_logger() -> Logger:
logger.log_json_list = lambda l: logger.info(json.dumps(list(l), indent=1))
logger.handlers = [fh]
return logger


@pytest.fixture(name="ignored_fields")
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you need fixture for this? Fixture galore makes code vary hard to read, just use input .

Copy link
Contributor

@avida avida left a comment

Choose a reason for hiding this comment

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

Please bump SAT version, add docs and change input format to more generic one, like here #6433

configured_catalog_path: "integration_tests/configured_catalog_without_insights.json"
configured_catalog_path: "integration_tests/configured_catalog.json"
ignored_fields:
"ads_insights_age_and_gender": [ "cost_per_estimated_ad_recallers", ]
Copy link
Contributor

Choose a reason for hiding this comment

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

This config is specific to your case, please make it more general, like described in this issue #6433

@@ -59,6 +60,18 @@ def filter_output(records: Iterable[AirbyteMessage], type_) -> List[AirbyteMessa
return list(filter(lambda x: x.type == type_, records))


def remove_ignored_fields(output: List[AirbyteMessage], ignored_fields: Mapping[str, List[str]]) -> List[Mapping[str, Any]]:
Copy link
Contributor

Choose a reason for hiding this comment

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

this function does too much and doesn't reflect its name.
how about have additional argument in serialize function:

def serialize(value, exclude_fields=None):
...

then your code will be:

serializer = partial(serialize, exclude_fields= ignored_fields)
output_diff = set(map(serializer, records_1)) - set(map(serializer, records_2))

Copy link
Contributor

@keu keu left a comment

Choose a reason for hiding this comment

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

see comments

@vitaliizazmic vitaliizazmic linked an issue Oct 11, 2021 that may be closed by this pull request
@vitaliizazmic
Copy link
Contributor Author

vitaliizazmic commented Oct 18, 2021

/test connector=source-facebook-marketing

🕑 source-facebook-marketing https://github.com/airbytehq/airbyte/actions/runs/1356437640
❌ source-facebook-marketing https://github.com/airbytehq/airbyte/actions/runs/1356437640
🐛 https://gradle.com/s/yxbp7tqcmw67c

@vitaliizazmic vitaliizazmic temporarily deployed to more-secrets October 18, 2021 20:50 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets October 18, 2021 20:51 Inactive
@vitaliizazmic vitaliizazmic requested review from avida and keu October 18, 2021 21:00
@vitaliizazmic vitaliizazmic temporarily deployed to more-secrets October 28, 2021 13:57 Inactive
@vitaliizazmic vitaliizazmic temporarily deployed to more-secrets October 29, 2021 11:01 Inactive
@github-actions github-actions bot added the area/documentation Improvements or additions to documentation label Oct 29, 2021
@vitaliizazmic vitaliizazmic temporarily deployed to more-secrets October 29, 2021 11:46 Inactive
…sh_test_failed

# Conflicts:
#	airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/tests/test_full_refresh.py
#	airbyte-integrations/bases/source-acceptance-test/source_acceptance_test/utils/compare.py
#	airbyte-integrations/bases/source-acceptance-test/unit_tests/test_utils.py
#	docs/connector-development/testing-connectors/source-acceptance-tests-reference.md
@vitaliizazmic
Copy link
Contributor Author

vitaliizazmic commented Nov 1, 2021

/test connector=bases/source-acceptance-test

🕑 bases/source-acceptance-test https://github.com/airbytehq/airbyte/actions/runs/1408333483
✅ bases/source-acceptance-test https://github.com/airbytehq/airbyte/actions/runs/1408333483
No Python unittests run

@vitaliizazmic vitaliizazmic temporarily deployed to more-secrets November 1, 2021 14:37 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets November 1, 2021 14:38 Inactive
@vitaliizazmic
Copy link
Contributor Author

vitaliizazmic commented Nov 1, 2021

/publish connector=bases/source-acceptance-test

🕑 bases/source-acceptance-test https://github.com/airbytehq/airbyte/actions/runs/1408364598
✅ bases/source-acceptance-test https://github.com/airbytehq/airbyte/actions/runs/1408364598

@vitaliizazmic vitaliizazmic temporarily deployed to more-secrets November 1, 2021 14:45 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets November 1, 2021 14:47 Inactive
@vitaliizazmic vitaliizazmic temporarily deployed to more-secrets November 1, 2021 14:53 Inactive
@vitaliizazmic
Copy link
Contributor Author

vitaliizazmic commented Nov 1, 2021

/publish connector=bases/source-acceptance-test

🕑 bases/source-acceptance-test https://github.com/airbytehq/airbyte/actions/runs/1408449270
✅ bases/source-acceptance-test https://github.com/airbytehq/airbyte/actions/runs/1408449270

@vitaliizazmic vitaliizazmic temporarily deployed to more-secrets November 1, 2021 15:08 Inactive
@jrhizor jrhizor temporarily deployed to more-secrets November 1, 2021 15:09 Inactive
@vitaliizazmic vitaliizazmic temporarily deployed to more-secrets November 1, 2021 15:15 Inactive
@vitaliizazmic vitaliizazmic merged commit 1d922ca into master Nov 1, 2021
@vitaliizazmic vitaliizazmic deleted the vitalii/5190_facebook_marketing_full_refresh_test_failed branch November 1, 2021 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Facebook Conversion Data Missing
8 participants