Skip to content

Commit

Permalink
fixed unit_tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bazarnov committed Mar 3, 2022
1 parent 2a879c2 commit 9141b8e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ def test_privileges_validation(requests_mock, basic_config):
"orders",
"abandoned_checkouts",
"metafields",
"order_refund",
"order_risk",
"orders_refund",
"orders_risk",
"tender_transactions",
"transactions",
"fulfillments",
Expand Down

1 comment on commit 9141b8e

@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 Shopify(#10794)

Measures

Name Value Name Value Name Value
Code Smells 2 Bugs 0 Duplicated Blocks 0
Lines of Code 482 Duplicated Lines (%) 0.0 Lines to Cover 2
Quality Gate Status OK Security Rating A Coverage 100.0
Vulnerabilities 0 Reliability Rating A Blocker Issues 0
Critical Issues 2 Major Issues 10 Minor Issues 74

Detected Issues

Rule File Description Message
python:mypy_arg_type (MINOR) source_shopify/source.py:483 Check argument types in calls Argument 1 to "OrdersRefund" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: OrdersRefund(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:484 Check argument types in calls Argument 1 to "OrdersRisk" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: OrdersRisk(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:485 Check argument types in calls Argument 1 to "TenderTransactions" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: TenderTransactions(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:447 Check argument types in calls Argument 1 to "Shop" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: response = list(Shop(config).read_records(sync_mode=None))
python:mypy_union_attr (MINOR) source_shopify/source.py:470 Check that attribute exists in each item of a union Item "None" of "Optional[List[str]]" has no attribute "iter" (not iterable) . Code line: for stream in SCOPES_MAPPING.get(user_scope["handle"])
python:mypy_assignment (MINOR) source_shopify/auth.py:34 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "Optional[Any]", variable has type "str") . Code line: auth_method: str = credentials.get("auth_method")
python:mypy_arg_type (MINOR) source_shopify/source.py Check argument types in calls Argument 1 to "OrderRefunds" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: OrderRefunds(config),
python:mypy_arg_type (MINOR) source_shopify/source.py Check argument types in calls Argument 1 to "OrderRisks" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: OrderRisks(config),
python:mypy_misc (MINOR) source_shopify/source.py:70 Miscellaneous other checks Incompatible types in "yield" (actual type "Iterable[MutableMapping[Any, Any]]", expected type "Mapping[Any, Any]") . Code line: yield self._transformer.transform(records)
python:S5890 (MAJOR) source_shopify/source.py:161 Values assigned to variables should match their type annotations Assign to "nested_record_field_name" a value of type "str" instead of "NoneType" or update its type hint.
python:mypy_assignment (MINOR) source_shopify/source.py:161 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "str") . Code line: nested_record_field_name: str = None
python:mypy_unreachable (MINOR) source_shopify/source.py:184 Warn about unreachable statements or expressions Statement is unreachable . Code line: if record.get(self.nested_substream):
python:mypy_union_attr (MINOR) source_shopify/source.py:197 Check that attribute exists in each item of a union Item "None" of "Optional[Mapping[str, Any]]" has no attribute "get" . Code line: slice_data = stream_slice.get(self.slice_key)
python:mypy_assignment (MINOR) source_shopify/source.py:291 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", base class "ChildSubstream" defined the type as "None") . Code line: nested_substream = "refunds"
python:mypy_index (MINOR) source_shopify/source.py:402 Check indexing operations Value of type "Optional[Mapping[str, Any]]" is not indexable . Code line: ...n(str(x[self.nested_record_field_name]) for x in stream_slice[self.sli...
python:mypy_index (MINOR) source_shopify/source.py:445 Check indexing operations Unsupported target for indexed assignment ("Mapping[str, Any]") . Code line: config["authenticator"] = ShopifyAuthenticator(config)
python:mypy_no_any_return (MINOR) source_shopify/transform.py:100 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Iterable[MutableMapping[Any, Any]]" . Code line: return self._transform_string(field)
python:mypy_arg_type (MINOR) source_shopify/source.py:495 Check argument types in calls Argument 1 to "Shop" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Shop(config),
python:mypy_union_attr (MINOR) source_shopify/source.py:114 Check that attribute exists in each item of a union Item "str" of "Union[str, Any]" has no attribute "get" . Code line: if record.get(self.cursor_field, "") >= stream_state.g...
python:S5890 (MAJOR) source_shopify/source.py:395 Values assigned to variables should match their type annotations Assign to "parent_stream_class" a value of type "object" or update its type hint.
python:mypy_arg_type (MINOR) source_shopify/source.py:491 Check argument types in calls Argument 1 to "InventoryItems" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: InventoryItems(config),
python:S5890 (MAJOR) source_shopify/source.py:407 Values assigned to variables should match their type annotations Assign to "parent_stream_class" a value of type "object" or update its type hint.
python:mypy_index (MINOR) source_shopify/source.py:415 Check indexing operations Value of type "Optional[Mapping[str, Any]]" is not indexable . Code line: order_id = stream_slice[self.slice_key]
python:S5890 (MAJOR) source_shopify/source.py:423 Values assigned to variables should match their type annotations Assign to "parent_stream_class" a value of type "object" or update its type hint.
python:mypy_index (MINOR) source_shopify/source.py:429 Check indexing operations Value of type "Optional[Mapping[str, Any]]" is not indexable . Code line: order_id = stream_slice[self.slice_key]
python:mypy_arg_type (MINOR) source_shopify/source.py:493 Check argument types in calls Argument 1 to "FulfillmentOrders" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: FulfillmentOrders(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:494 Check argument types in calls Argument 1 to "Fulfillments" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Fulfillments(config),
python:S5890 (MAJOR) source_shopify/source.py:374 Values assigned to variables should match their type annotations Assign to "parent_stream_class" a value of type "object" or update its type hint.
python:mypy_index (MINOR) source_shopify/source.py:380 Check indexing operations Value of type "Optional[Mapping[str, Any]]" is not indexable . Code line: location_id = stream_slice["location_id"]
python:mypy_arg_type (MINOR) source_shopify/source.py:490 Check argument types in calls Argument 1 to "Locations" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Locations(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:492 Check argument types in calls Argument 1 to "InventoryLevels" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: InventoryLevels(config),
python:mypy_index (MINOR) source_shopify/source.py:460 Check indexing operations Unsupported target for indexed assignment ("Mapping[str, Any]") . Code line: config["authenticator"] = ShopifyAuthenticator(config)
python:mypy_arg_type (MINOR) source_shopify/source.py:97 Check argument types in calls Argument 1 to "cache_stream_state" has incompatible type "Callable[[IncrementalShopifyStream, Optional[Mapping[str, Any]], Optional[Mapping[str, Any]], KwArg(Any)], Any]"; expected "EagerlyCachedStreamState" . Code line: @stream_state_cache.cache_stream_state
python:S5890 (MAJOR) source_shopify/source.py:159 Values assigned to variables should match their type annotations Assign to "slice_key" a value of type "str" instead of "NoneType" or update its type hint.
python:mypy_assignment (MINOR) source_shopify/source.py:159 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "str") . Code line: slice_key: str = None
python:mypy_operator (MINOR) source_shopify/source.py:177 Check that operator is valid for operands "object" not callable . Code line: parent_stream = self.parent_stream_class(self.config)
python:S5890 (MAJOR) source_shopify/source.py:285 Values assigned to variables should match their type annotations Assign to "parent_stream_class" a value of type "object" or update its type hint.
python:S5890 (MAJOR) source_shopify/source.py:299 Values assigned to variables should match their type annotations Assign to "parent_stream_class" a value of type "object" or update its type hint.
python:S5890 (MAJOR) source_shopify/source.py:314 Values assigned to variables should match their type annotations Assign to "parent_stream_class" a value of type "object" or update its type hint.
python:S5890 (MAJOR) source_shopify/source.py:349 Values assigned to variables should match their type annotations Assign to "parent_stream_class" a value of type "object" or update its type hint.
python:mypy_attr_defined (MINOR) source_shopify/utils.py:135 Check that attribute exists "object" has no attribute "cursor_field" . Code line: state_object[stream.name] = {stream.cursor_field: current_...
python:mypy_attr_defined (MINOR) source_shopify/utils.py:135 Check that attribute exists "object" has no attribute "name" . Code line: state_object[stream.name] = {stream.cursor_field: current_...
python:mypy_misc (MINOR) source_shopify/source.py:76 Miscellaneous other checks Incompatible types in "yield" (actual type "Iterable[MutableMapping[Any, Any]]", expected type "Mapping[Any, Any]") . Code line: yield self._transformer.transform(record)
python:mypy_return_value (MINOR) source_shopify/transform.py:45 Check that return value is compatible with signature Incompatible return value type (got "Optional[List[str]]", expected "List[str]") . Code line: return json_types.get(value_type)
python:mypy_no_any_return (MINOR) source_shopify/transform.py:54 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "str" . Code line: return schema_types
python:mypy_arg_type (MINOR) source_shopify/transform.py:95 Check argument types in calls Argument 1 to "_first_non_null_type" of "DataTypeEnforcer" has incompatible type "str"; expected "List[str]" . Code line: schema_type = self._first_non_null_type(schema_types)
python:mypy_no_any_return (MINOR) source_shopify/transform.py:98 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Iterable[MutableMapping[Any, Any]]" . Code line: return self._transform_number(field)
python:mypy_no_any_return (MINOR) source_shopify/transform.py:103 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Iterable[MutableMapping[Any, Any]]" . Code line: return self._transform_object(field, properties)
python:mypy_no_any_return (MINOR) source_shopify/transform.py:106 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Iterable[MutableMapping[Any, Any]]" . Code line: return self._transform_array(field, properties)
python:mypy_no_any_return (MINOR) source_shopify/transform.py:107 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Iterable[MutableMapping[Any, Any]]" . Code line: return field
python:mypy_arg_type (MINOR) source_shopify/source.py:475 Check argument types in calls Argument 1 to "Customers" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Customers(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:476 Check argument types in calls Argument 1 to "Orders" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Orders(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:477 Check argument types in calls Argument 1 to "DraftOrders" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: DraftOrders(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:478 Check argument types in calls Argument 1 to "Products" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Products(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:479 Check argument types in calls Argument 1 to "AbandonedCheckouts" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: AbandonedCheckouts(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:480 Check argument types in calls Argument 1 to "Metafields" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Metafields(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:481 Check argument types in calls Argument 1 to "CustomCollections" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: CustomCollections(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:482 Check argument types in calls Argument 1 to "Collects" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Collects(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:486 Check argument types in calls Argument 1 to "Transactions" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Transactions(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:487 Check argument types in calls Argument 1 to "Pages" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Pages(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:488 Check argument types in calls Argument 1 to "PriceRules" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: PriceRules(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:489 Check argument types in calls Argument 1 to "DiscountCodes" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: DiscountCodes(config),
python:mypy_attr_defined (MINOR) source_shopify/utils.py:132 Check that attribute exists "object" has no attribute "name" . Code line: ... tmp_stream_state_value = state_object.get(stream.name, {}).get(...
python:mypy_attr_defined (MINOR) source_shopify/utils.py:132 Check that attribute exists "object" has no attribute "cursor_field" . Code line: ...te_value = state_object.get(stream.name, {}).get(stream.cursor_field, ...
python:mypy_attr_defined (MINOR) source_shopify/utils.py:138 Check that attribute exists "object" has no attribute "name" . Code line: state_object[stream.name] = {
python:mypy_attr_defined (MINOR) source_shopify/utils.py:139 Check that attribute exists "object" has no attribute "cursor_field" . Code line: stream.cursor_field: min(current_stream_state.get(...
python:S5720 (CRITICAL) source_shopify/utils.py:143 "self" should be the first argument to instance methods Rename "func" to "self" or add the missing "self" parameter.
python:mypy_import (MINOR) source_shopify/utils.py:10 Require that imported module can be found or has stubs Library stubs not installed for "requests" (or incompatible with Python 3.7) . Code line: import requests
python:S5720 (CRITICAL) source_shopify/utils.py:87 "self" should be the first argument to instance methods Rename "threshold" to "self" or add the missing "self" parameter.
python:mypy_misc (MINOR) source_shopify/utils.py:87 Miscellaneous other checks Self argument missing for a non-static method (or an invalid type for self) . Code line: def balance_rate_limit(threshold: float = 0.9, rate_limit_header: ...
python:mypy_assignment (MINOR) source_shopify/source.py:55 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", target has type "int") . Code line: params["order"] = f"{self.order_field} asc"
python:mypy_union_attr (MINOR) source_shopify/source.py:113 Check that attribute exists in each item of a union Item "None" of "Optional[Mapping[str, Any]]" has no attribute "iter" (not iterable) . Code line: for record in records_slice:
python:mypy_misc (MINOR) source_shopify/source.py:117 Miscellaneous other checks "yield from" can't be applied to "Optional[Mapping[str, Any]]" . Code line: yield from records_slice
python:mypy_override (MINOR) source_shopify/source.py:133 Check that method override is compatible with base class Signature of "request_params" incompatible with supertype "ShopifyStream" . Code line: def request_params(
python:mypy_override (MINOR) source_shopify/source.py:228 Check that method override is compatible with base class Signature of "request_params" incompatible with supertype "ShopifyStream" . Code line: def request_params(
python:mypy_override (MINOR) source_shopify/source.py:274 Check that method override is compatible with base class Signature of "request_params" incompatible with supertype "ShopifyStream" . Code line: def request_params(
python:mypy_no_any_return (MINOR) source_shopify/source.py:139 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "MutableMapping[str, Any]" . Code line: return params
python:mypy_no_any_return (MINOR) source_shopify/source.py:235 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "MutableMapping[str, Any]" . Code line: return params
python:mypy_index (MINOR) source_shopify/source.py:355 Check indexing operations Value of type "Optional[Mapping[str, Any]]" is not indexable . Code line: price_rule_id = stream_slice["price_rule_id"]
python:mypy_index (MINOR) source_shopify/source.py:306 Check indexing operations Value of type "Optional[Mapping[str, Any]]" is not indexable . Code line: order_id = stream_slice["order_id"]
python:mypy_import (MINOR) source_shopify/source.py:10 Require that imported module can be found or has stubs Library stubs not installed for "requests" (or incompatible with Python 3.7) . Code line: import requests
python:mypy_no_any_return (MINOR) source_shopify/source.py:281 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "MutableMapping[str, Any]" . Code line: return params
python:mypy_index (MINOR) source_shopify/source.py:294 Check indexing operations Value of type "Optional[Mapping[str, Any]]" is not indexable . Code line: order_id = stream_slice["order_id"]
python:mypy_index (MINOR) source_shopify/source.py:321 Check indexing operations Value of type "Optional[Mapping[str, Any]]" is not indexable . Code line: order_id = stream_slice["order_id"]
python:mypy_return (MINOR) source_shopify/source.py:441 Check that function always returns a value Missing return statement . Code line: def check_connection(self, logger: AirbyteLogger, config: Mapping[...
python:mypy_valid_type (MINOR) source_shopify/source.py:441 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]:

Coverage (100.0%)

File Coverage File Coverage
source_shopify/init.py 100.0 source_shopify/auth.py 80.0
source_shopify/source.py 61.9 source_shopify/transform.py 94.8
source_shopify/utils.py 89.3

Please sign in to comment.