Skip to content

Commit

Permalink
Google Ads #8331 - add network fields to click_view stream schema
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaliizazmic committed Feb 10, 2022
1 parent f0113c9 commit 2bc34a6
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,21 @@
},
"campaign.name": {
"type": ["null", "string"]
},
"segments.ad_network_type": {
"type": ["null", "string"]
},
"campaign.network_settings.target_content_network": {
"type": ["null", "boolean"]
},
"campaign.network_settings.target_google_search": {
"type": ["null", "boolean"]
},
"campaign.network_settings.target_partner_search_network": {
"type": ["null", "boolean"]
},
"campaign.network_settings.target_search_network": {
"type": ["null", "boolean"]
}
}
}

1 comment on commit 2bc34a6

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

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

SonarQube Report

SonarQube report for Airbyte Connectors Source Google Ads(#10372)

Measures

Name Value Name Value Name Value
Lines of Code 1252 Lines to Cover 693 Reliability Rating C
Code Smells 96 Bugs 1 Vulnerabilities 0
Security Rating A Quality Gate Status OK Duplicated Blocks 0
Duplicated Lines (%) 0.0 Coverage 34.8 Blocker Issues 0
Critical Issues 10 Major Issues 14 Minor Issues 73

Detected Issues

Rule File Description Message
python:isort_need_format (MINOR) integration_tests/test_incremental.py Please run one of the commands: "isort <path_to_updated_folder>" or "./gradlew format" 1 code part(s) should be updated.
python:S1192 (CRITICAL) integration_tests/test_incremental.py:35 String literals should not be duplicated Define a constant instead of duplicating this literal "segments.date" 13 times.
python:S3776 (CRITICAL) integration_tests/test_incremental.py:50 Cognitive Complexity of functions should not be too high Refactor this function to reduce its Cognitive Complexity from 24 to the 15 allowed.
python:isort_need_format (MINOR) source_google_ads/google_ads.py Please run one of the commands: "isort <path_to_updated_folder>" or "./gradlew format" 1 code part(s) should be updated.
python:mypy_index (MINOR) source_google_ads/google_ads.py:37 Check indexing operations Unsupported target for indexed assignment ("Mapping[str, Any]") . Code line: credentials["use_proto_plus"] = True
python:mypy_no_any_return (MINOR) source_google_ads/source.py:52 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Dict[Any, Any]" . Code line: return next(accounts_streams.read_records(sync_mode=SyncMo...
python:mypy_call_overload (MINOR) source_google_ads/source.py:52 Check that an overload variant matches arguments No overload variant of "next" matches argument types "Iterable[Mapping[str, Any]]", "Dict[, ]" . Code line: return next(accounts_streams.read_records(sync_mode=SyncMo...
python:isort_need_format (MINOR) source_google_ads/streams.py Please run one of the commands: "isort <path_to_updated_folder>" or "./gradlew format" 1 code part(s) should be updated.
python:mypy_valid_type (MINOR) source_google_ads/streams.py:97 Check that type (annotation) is valid Function "builtins.any" is not valid as a type . Code line: ...[str, Any] = None, **kwargs) -> Iterable[Optional[Mapping[str, any]]]:
python:mypy_no_untyped_def (MINOR) source_google_ads/streams.py:97 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def stream_slices(self, stream_state: Mapping[str, Any] = None, **...
python:mypy_assignment (MINOR) source_google_ads/streams.py:99 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", variable has type "None") . Code line: self._customer_id = customer_id
python:mypy_assignment (MINOR) source_google_ads/streams.py:123 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", variable has type "None") . Code line: self._customer_id = customer_id
python:S3776 (CRITICAL) source_google_ads/streams.py:147 Cognitive Complexity of functions should not be too high Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed.
python:mypy_index (MINOR) source_google_ads/streams.py:179 Check indexing operations Unsupported target for indexed assignment ("Optional[Mapping[str, Any]]") . Code line: stream_slice["start_date"] = state.get(self._custo...
python:mypy_union_attr (MINOR) source_google_ads/streams.py:202 Check that attribute exists in each item of a union Item "Time" of "Union[Date, Time, Duration]" has no attribute "to_date_string" . Code line: ... {self._customer_id: {self.cursor_field: (max(date_in_current_s...
python:mypy_union_attr (MINOR) source_google_ads/streams.py:202 Check that attribute exists in each item of a union Item "Duration" of "Union[Date, Time, Duration]" has no attribute "to_date_string" . Code line: ... {self._customer_id: {self.cursor_field: (max(date_in_current_s...
python:isort_need_format (MINOR) unit_tests/test_google_ads.py Please run one of the commands: "isort <path_to_updated_folder>" or "./gradlew format" 1 code part(s) should be updated.
python:isort_need_format (MINOR) unit_tests/test_source.py Please run one of the commands: "isort <path_to_updated_folder>" or "./gradlew format" 1 code part(s) should be updated.
python:S1192 (CRITICAL) unit_tests/test_source.py:102 String literals should not be duplicated Define a constant instead of duplicating this literal "segments.date" 11 times.
python:isort_need_format (MINOR) unit_tests/test_streams.py Please run one of the commands: "isort <path_to_updated_folder>" or "./gradlew format" 1 code part(s) should be updated.
python:mypy_valid_type (MINOR) source_google_ads/streams.py:17 Check that type (annotation) is valid Function is missing a type annotation [no-untyped-def] def parse_dates(stream_slice):
python:mypy_no_untyped_def (MINOR) source_google_ads/streams.py:23 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def get_date_params(start_date: str, time_zone=None, range_days: int =...
flake8:E501 (MAJOR) source_google_ads/streams.py:26 line too long (82 > 79 characters) line too long (143 > 140 characters)
python:mypy_operator (MINOR) source_google_ads/streams.py:33 Check that operator is valid for operands Unsupported operand types for > ("Time" and "DateTime") . Code line: if start_date > pendulum.now():
python:mypy_operator (MINOR) source_google_ads/streams.py:33 Check that operator is valid for operands Unsupported operand types for > ("Duration" and "DateTime") . Code line: if start_date > pendulum.now():
python:mypy_union_attr (MINOR) source_google_ads/streams.py:34 Check that attribute exists in each item of a union Item "Time" of "Union[Date, Time, DateTime, Duration]" has no attribute "to_date_string" . Code line: return start_date.to_date_string(), start_date.add(days=1).to_...
python:mypy_union_attr (MINOR) source_google_ads/streams.py:34 Check that attribute exists in each item of a union Item "Duration" of "Union[Date, Time, DateTime, Duration]" has no attribute "to_date_string" . Code line: return start_date.to_date_string(), start_date.add(days=1).to_...
python:mypy_union_attr (MINOR) source_google_ads/streams.py:34 Check that attribute exists in each item of a union Item "Duration" of "Union[Date, Time, DateTime, Duration]" has no attribute "add" . Code line: return start_date.to_date_string(), start_date.add(days=1).to_...
python:mypy_call_arg (MINOR) source_google_ads/streams.py:34 Check number, names and kinds of arguments in calls Unexpected keyword argument "days" for "add" . Code line: return start_date.to_date_string(), start_date.add(days=1).to_...
python:mypy_union_attr (MINOR) source_google_ads/streams.py:35 Check that attribute exists in each item of a union Item "Duration" of "Union[Date, Time, DateTime, Duration]" has no attribute "add" . Code line: end_date = min(end_date, start_date.add(days=range_days))
python:mypy_call_arg (MINOR) source_google_ads/streams.py:35 Check number, names and kinds of arguments in calls Unexpected keyword argument "days" for "add" . Code line: end_date = min(end_date, start_date.add(days=range_days))
python:mypy_union_attr (MINOR) source_google_ads/streams.py:38 Check that attribute exists in each item of a union Item "Duration" of "Union[Date, Time, DateTime, Duration]" has no attribute "add" . Code line: if start_date.add(days=1).date() >= end_date.date():
python:mypy_call_arg (MINOR) source_google_ads/streams.py:38 Check number, names and kinds of arguments in calls Unexpected keyword argument "days" for "add" . Code line: if start_date.add(days=1).date() >= end_date.date():
python:mypy_union_attr (MINOR) source_google_ads/streams.py:39 Check that attribute exists in each item of a union Item "Duration" of "Union[Date, Time, DateTime, Duration]" has no attribute "add" . Code line: ... return start_date.add(days=1).to_date_string(), start_date.add(days=2...
python:mypy_call_arg (MINOR) source_google_ads/streams.py:39 Check number, names and kinds of arguments in calls Unexpected keyword argument "days" for "add" . Code line: ... return start_date.add(days=1).to_date_string(), start_date.add(days=2...
python:mypy_union_attr (MINOR) source_google_ads/streams.py:39 Check that attribute exists in each item of a union Item "Duration" of "Union[Date, Time, DateTime, Duration]" has no attribute "add" . Code line: return start_date.add(days=1).to_date_string(), start_date.add...
python:mypy_call_arg (MINOR) source_google_ads/streams.py:39 Check number, names and kinds of arguments in calls Unexpected keyword argument "days" for "add" . Code line: return start_date.add(days=1).to_date_string(), start_date.add...
python:mypy_union_attr (MINOR) source_google_ads/streams.py:40 Check that attribute exists in each item of a union Item "Duration" of "Union[Date, Time, DateTime, Duration]" has no attribute "add" . Code line: return start_date.add(days=1).to_date_string(), end_date.to_date_s...
python:mypy_call_arg (MINOR) source_google_ads/streams.py:40 Check number, names and kinds of arguments in calls Unexpected keyword argument "days" for "add" . Code line: return start_date.add(days=1).to_date_string(), end_date.to_date_s...
python:mypy_override (MINOR) source_google_ads/streams.py:147 Check that method override is compatible with base class Signature of "read_records" incompatible with supertype "GoogleAdsStream" . Code line: def read_records(
python:mypy_arg_type (MINOR) source_google_ads/streams.py:163 Check argument types in calls Argument 1 to "get_updated_state" of "IncrementalGoogleAdsStream" has incompatible type "Mapping[str, Any]"; expected "MutableMapping[str, Any]" . Code line: state = self.get_updated_state(state, record)
python:S1871 (MAJOR) source_google_ads/streams.py:176 Two branches in a conditional structure should not have exactly the same implementation Either merge this branch with the identical one on line "171" or change one of the implementations.
python:mypy_no_untyped_def (MINOR) unit_tests/common.py:15 Check that every function has an annotation Function is missing a type annotation . Code line: def search(self, search_request):
python:mypy_no_untyped_def (MINOR) unit_tests/common.py:20 Check that every function has an annotation Function is missing a type annotation . Code line: def init(self, config):
python:mypy_no_untyped_def (MINOR) unit_tests/common.py:23 Check that every function has an annotation Function is missing a type annotation . Code line: def get_type(self, type):
python:mypy_no_untyped_def (MINOR) unit_tests/common.py:26 Check that every function has an annotation Function is missing a type annotation . Code line: def get_service(self, service):
python:mypy_no_untyped_def (MINOR) unit_tests/common.py:30 Check that every function has an annotation Function is missing a type annotation . Code line: def load_from_dict(config):
python:S1192 (CRITICAL) unit_tests/test_streams.py:52 String literals should not be duplicated Define a constant instead of duplicating this literal "click_view.gclid" 21 times.
python:S1192 (CRITICAL) unit_tests/test_streams.py:52 String literals should not be duplicated Define a constant instead of duplicating this literal "segments.date" 24 times.
python:mypy_no_untyped_def (MINOR) source_google_ads/streams.py:114 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def init(self, start_date: str, conversion_window_days: int, t...
python:S5655 (CRITICAL) unit_tests/test_source.py:20 Arguments given to functions should be of an expected type Change this argument; Function "chunk_date_range" expects a different type
python:S5655 (CRITICAL) unit_tests/test_source.py:20 Arguments given to functions should be of an expected type Change this argument; Function "chunk_date_range" expects a different type
python:S1192 (CRITICAL) unit_tests/test_source.py:282 String literals should not be duplicated Define a constant instead of duplicating this literal "campaign.end_date" 3 times.
flake8:E501 (MAJOR) source_google_ads/streams.py:112 line too long (82 > 79 characters) line too long (166 > 140 characters)
python:S112 (MAJOR) source_google_ads/source.py:85 "Exception" and "BaseException" should not be raised Replace this generic exception class with a more specific one.
python:mypy_no_untyped_def (MINOR) source_google_ads/source.py:49 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def get_account_info(google_api) -> dict:
python:mypy_valid_type (MINOR) source_google_ads/source.py:55 Check that type (annotation) is valid Function "pendulum.tz.timezone" is not valid as a type . Code line: def get_time_zone(account: dict) -> Union[timezone, str]:
python:mypy_no_untyped_def (MINOR) source_google_ads/streams.py:43 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def chunk_date_range(
python:mypy_valid_type (MINOR) source_google_ads/streams.py:51 Check that type (annotation) is valid Function "builtins.any" is not valid as a type . Code line: ) -> Iterable[Mapping[str, any]]:
python:mypy_assignment (MINOR) source_google_ads/streams.py:309 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "int", base class "IncrementalGoogleAdsStream" defined the type as "None") . Code line: days_of_data_storage = 90
python:isort_need_format (MINOR) main.py Please run one of the commands: "isort <path_to_updated_folder>" or "./gradlew format" 1 code part(s) should be updated.
python:mypy_no_untyped_def (MINOR) source_google_ads/custom_query_stream.py:13 Check that every function has an annotation Function is missing a type annotation . Code line: def init(self, custom_query_config, **kwargs):
python:mypy_override (MINOR) source_google_ads/custom_query_stream.py:19 Check that method override is compatible with base class Signature of "primary_key" incompatible with supertype "IncrementalGoogleAdsStream" . Code line: def primary_key(self) -> str:
python:S125 (MAJOR) source_google_ads/custom_query_stream.py:25 Sections of code should not be commented out Remove this commented out code.
python:S5886 (MAJOR) source_google_ads/custom_query_stream.py:26 Function return types should be consistent with their type hint Return a value of type "str" instead of "NoneType" or update function "primary_key" type hint.
python:mypy_no_untyped_def (MINOR) source_google_ads/custom_query_stream.py:29 Check that every function has an annotation Function is missing a return type annotation . Code line: def name(self):
python:mypy_dict_item (MINOR) source_google_ads/custom_query_stream.py:80 Check dict items in a dict expression {key: value, ...} Dict entry 1 has incompatible type "str": "bool"; expected "str": "Sequence[Any]" . Code line: ... field_value = {"type": output_type, "protobuf_message": T...
python:mypy_index (MINOR) source_google_ads/custom_query_stream.py:87 Check indexing operations Unsupported target for indexed assignment ("object") . Code line: local_json_schema["properties"][field] = field_value
python:S112 (MAJOR) source_google_ads/custom_query_stream.py:120 "Exception" and "BaseException" should not be raised Replace this generic exception class with a more specific one.
flake8:E203 (MAJOR) source_google_ads/custom_query_stream.py:145 whitespace before ‘:’ whitespace before ':'
python:S112 (MAJOR) source_google_ads/source.py:87 "Exception" and "BaseException" should not be raised Replace this generic exception class with a more specific one.
flake8:E501 (MAJOR) unit_tests/test_source.py:257 line too long (82 > 79 characters) line too long (142 > 140 characters)
flake8:E501 (MAJOR) unit_tests/test_google_ads.py:147 line too long (82 > 79 characters) line too long (147 > 140 characters)
python:mypy_no_any_return (MINOR) source_google_ads/source.py:46 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Mapping[str, Any]" . Code line: return credentials
flake8:E501 (MAJOR) source_google_ads/google_ads.py:156 line too long (82 > 79 characters) line too long (165 > 140 characters)
flake8:E501 (MAJOR) source_google_ads/google_ads.py:157 line too long (82 > 79 characters) line too long (173 > 140 characters)
python:mypy_operator (MINOR) source_google_ads/streams.py:66 Check that operator is valid for operands Unsupported operand types for > ("DateTime" and "Time") . Code line: if start_date > end_date:
python:mypy_operator (MINOR) source_google_ads/streams.py:66 Check that operator is valid for operands Unsupported operand types for > ("Date" and "Time") . Code line: if start_date > end_date:
python:mypy_operator (MINOR) source_google_ads/streams.py:66 Check that operator is valid for operands Unsupported operand types for > ("Date" and "Duration") . Code line: if start_date > end_date:
python:mypy_operator (MINOR) source_google_ads/streams.py:66 Check that operator is valid for operands Unsupported operand types for > ("Time" and "Date") . Code line: if start_date > end_date:
python:mypy_operator (MINOR) source_google_ads/streams.py:66 Check that operator is valid for operands Unsupported operand types for > ("Time" and "DateTime") . Code line: if start_date > end_date:
python:mypy_operator (MINOR) source_google_ads/streams.py:66 Check that operator is valid for operands Unsupported operand types for > ("Time" and "Duration") . Code line: if start_date > end_date:
python:mypy_operator (MINOR) source_google_ads/streams.py:66 Check that operator is valid for operands Unsupported operand types for > ("DateTime" and "Duration") . Code line: if start_date > end_date:
python:mypy_operator (MINOR) source_google_ads/streams.py:66 Check that operator is valid for operands Unsupported operand types for > ("Duration" and "Date") . Code line: if start_date > end_date:
python:mypy_operator (MINOR) source_google_ads/streams.py:66 Check that operator is valid for operands Unsupported operand types for > ("Duration" and "Time") . Code line: if start_date > end_date:
python:mypy_operator (MINOR) source_google_ads/streams.py:66 Check that operator is valid for operands Unsupported operand types for > ("Duration" and "DateTime") . Code line: if start_date > end_date:
python:mypy_union_attr (MINOR) source_google_ads/streams.py:70 Check that attribute exists in each item of a union Item "Duration" of "Union[Date, Time, DateTime, Duration]" has no attribute "subtract" . Code line: start_date = start_date.subtract(days=conversion_window)
python:mypy_call_arg (MINOR) source_google_ads/streams.py:70 Check number, names and kinds of arguments in calls Unexpected keyword argument "days" for "subtract" . Code line: start_date = start_date.subtract(days=conversion_window)
python:mypy_no_untyped_def (MINOR) source_google_ads/streams.py:102 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def read_records(self, sync_mode, stream_slice: Mapping[str, Any] ...
python:mypy_valid_type (MINOR) source_google_ads/streams.py:121 Check that type (annotation) is valid Function "builtins.any" is not valid as a type . Code line: ...[str, Any] = None, **kwargs) -> Iterable[Optional[Mapping[str, any]]]:
python:mypy_no_untyped_def (MINOR) source_google_ads/streams.py:121 Check that every function has an annotation Function is missing a type annotation for one or more arguments . Code line: def stream_slices(self, stream_state: Mapping[str, Any] = None, **...
python:mypy_valid_type (MINOR) source_google_ads/source.py:73 Check that type (annotation) is valid Function "builtins.any" is not valid as a type . Code line: ...logger: AirbyteLogger, config: Mapping[str, Any]) -> Tuple[bool, any]:
python:mypy_no_untyped_def (MINOR) integration_tests/acceptance.py:12 Check that every function has an annotation Function is missing a return type annotation . Code line: def connector_setup():
python:mypy_no_any_return (MINOR) source_google_ads/google_ads.py:170 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "str" . Code line: return field_value
python:mypy_no_untyped_def (MINOR) source_google_ads/google_ads.py:173 Check that every function has an annotation Function is missing a return type annotation . Code line: def parse_single_result(schema: Mapping[str, Any], result: GoogleA...
python:S1192 (CRITICAL) unit_tests/test_google_ads.py:17 String literals should not be duplicated Define a constant instead of duplicating this literal "segment.date" 3 times.
python:S1764 (MAJOR) unit_tests/test_google_ads.py:162 Identical expressions should not be used on both sides of a binary operator Correct one of the identical sub-expressions on both sides of operator "==".

Coverage (34.8%)

File Coverage File Coverage
integration_tests/acceptance.py 0.0 integration_tests/conftest.py 0.0
integration_tests/test_incremental.py 0.0 main.py 0.0
setup.py 0.0 source_google_ads/init.py 100.0
source_google_ads/custom_query_stream.py 60.8 source_google_ads/google_ads.py 79.4
source_google_ads/source.py 47.1 source_google_ads/streams.py 82.3
unit_tests/common.py 0.0 unit_tests/conftest.py 0.0
unit_tests/test_google_ads.py 0.0 unit_tests/test_source.py 0.0
unit_tests/test_streams.py 0.0

Please sign in to comment.