-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
🐛 Source Facebook Marketing: SAT ignored fields in TestFullRefresh.test_sequential_reads #6463
Conversation
…llers for AdsInsights streams if not presented in records
/test connector=source-facebook-marketing
|
…sh_test_failed # Conflicts: # airbyte-integrations/connectors/source-facebook-marketing/acceptance-test-config.yml
/test connector=source-facebook-marketing
|
@@ -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") |
There was a problem hiding this comment.
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 .
There was a problem hiding this 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", ] |
There was a problem hiding this comment.
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]]: |
There was a problem hiding this comment.
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))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comments
/test connector=source-facebook-marketing
|
…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
/test connector=bases/source-acceptance-test
|
/publish connector=bases/source-acceptance-test
|
/publish connector=bases/source-acceptance-test
|
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
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/integrations/<source or destination>/<name>.md
including changelog. See changelog example