Skip to content

Commit

Permalink
fix eof
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosmarxm committed Feb 24, 2022
1 parent 89bf0af commit 53f1c96
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2,026 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,17 @@
"type": ["null", "integer"]
}
},
"companies": {
"type": ["null", "array"],
"items": {
"type": ["null", "string"]
}
},
"deals": {
"type": ["null", "array"],
"items": {
"type": ["null", "string"]
}
}
}
}
}
Loading

1 comment on commit 53f1c96

@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 Hubspot(#10631)

Measures

Name Value Name Value Name Value
Security Rating A Quality Gate Status OK Reliability Rating A
Duplicated Lines (%) 0.0 Code Smells 127 Duplicated Blocks 0
Bugs 0 Lines to Cover 749 Lines of Code 1108
Vulnerabilities 0 Coverage 81.3 Blocker Issues 0
Critical Issues 2 Major Issues 16 Minor Issues 182

Detected Issues

Rule File Description Message
python:mypy_return (MINOR) source_hubspot/streams.py:362 Check that function always returns a value Missing return statement . Code line: def _convert_datetime_to_string(dt: pendulum.datetime, declared_fo...
python:mypy_assignment (MINOR) source_hubspot/streams.py:362 Check that assigned value is compatible with target Incompatible default for argument "declared_format" (default has type "None", argument has type "str") . Code line: ..._to_string(dt: pendulum.datetime, declared_format: str = None) -> str:
python:mypy_no_any_return (MINOR) source_hubspot/streams.py:364 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "str" . Code line: return dt.to_date_string()
python:mypy_attr_defined (MINOR) source_hubspot/streams.py:364 Check that attribute exists pendulum.datetime? has no attribute "to_date_string" . Code line: return dt.to_date_string()
python:mypy_no_any_return (MINOR) source_hubspot/streams.py:366 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "str" . Code line: return dt.to_datetime_string()
python:mypy_attr_defined (MINOR) source_hubspot/streams.py:366 Check that attribute exists pendulum.datetime? has no attribute "to_datetime_string" . Code line: return dt.to_datetime_string()
python:mypy_assignment (MINOR) source_hubspot/streams.py:369 Check that assigned value is compatible with target Incompatible default for argument "declared_format" (default has type "None", argument has type "str") . Code line: ...ield_name: str, field_value: Any, declared_format: str = None) -> Any:
python:mypy_attr_defined (MINOR) source_hubspot/streams.py:377 Check that attribute exists Module has no attribute "parse" . Code line: dt = pendulum.parse(field_value)
python:mypy_assignment (MINOR) source_hubspot/streams.py:393 Check that assigned value is compatible with target Incompatible default for argument "declared_format" (default has type "None", argument has type "str") . Code line: ...ield_name: str, field_value: Any, declared_format: str = None) -> Any:
python:mypy_import (MINOR) source_hubspot/source.py:15 Require that imported module can be found or has stubs Library stubs not installed for "requests" (or incompatible with Python 3.7) . Code line: from requests import HTTPError
python:mypy_assignment (MINOR) source_hubspot/source.py:117 Check that assigned value is compatible with target Incompatible default for argument "state" (default has type "None", argument has type "MutableMapping[str, Any]") . Code line: ...alog: ConfiguredAirbyteCatalog, state: MutableMapping[str, Any] = None
python:mypy_import (MINOR) source_hubspot/streams.py:16 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_var_annotated (MINOR) source_hubspot/streams.py:63 Require variable annotation if type can't be inferred Need type annotation for "local_properties" (hint: "local_properties: List[] = ...") . Code line: local_properties = []
python:mypy_misc (MINOR) source_hubspot/streams.py:66 Miscellaneous other checks Incompatible types in "yield" (actual type "List[Any]", expected type "Tuple[str]") . Code line: yield local_properties
python:mypy_misc (MINOR) source_hubspot/streams.py:74 Miscellaneous other checks Incompatible types in "yield" (actual type "List[str]", expected type "Tuple[str]") . Code line: yield local_properties
python:S112 (MAJOR) source_hubspot/streams.py:148 "Exception" and "BaseException" should not be raised Replace this generic exception class with a more specific one.
python:mypy_no_any_return (MINOR) source_hubspot/streams.py:179 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Union[MutableMapping[str, Any], List[MutableMapping[str, Any]]]" . Code line: return response.json()
python:mypy_assignment (MINOR) source_hubspot/streams.py:184 Check that assigned value is compatible with target Incompatible default for argument "params" (default has type "None", argument has type "MutableMapping[str, Any]") . Code line: self, url: str, params: MutableMapping[str, Any] = None
python:mypy_assignment (MINOR) source_hubspot/streams.py:190 Check that assigned value is compatible with target Incompatible default for argument "params" (default has type "None", argument has type "MutableMapping[str, Any]") . Code line: ... str, data: Mapping[str, Any], params: MutableMapping[str, Any] = None
python:mypy_return_value (MINOR) source_hubspot/streams.py:193 Check that return value is compatible with signature Incompatible return value type (got "Tuple[Union[MutableMapping[str, Any], List[MutableMapping[str, Any]]], Any]", expected "Tuple[Union[Mapping[str, Any], List[Mapping[str, Any]]], Any]") . Code line: return self._parse_and_handle_errors(response), response
python:S5890 (MAJOR) source_hubspot/streams.py:199 Values assigned to variables should match their type annotations Assign to "entity" a value of type "str" instead of "NoneType" or update its type hint.
python:mypy_assignment (MINOR) source_hubspot/streams.py:199 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "str") . Code line: entity: str = None
python:S5890 (MAJOR) source_hubspot/streams.py:200 Values assigned to variables should match their type annotations Assign to "updated_at_field" a value of type "str" instead of "NoneType" or update its type hint.
python:mypy_assignment (MINOR) source_hubspot/streams.py:200 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "str") . Code line: updated_at_field: str = None
python:S5890 (MAJOR) source_hubspot/streams.py:201 Values assigned to variables should match their type annotations Assign to "created_at_field" a value of type "str" instead of "NoneType" or update its type hint.
python:mypy_assignment (MINOR) source_hubspot/streams.py:201 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "str") . Code line: created_at_field: str = None
python:S5890 (MAJOR) source_hubspot/streams.py:203 Values assigned to variables should match their type annotations Assign to "more_key" a value of type "str" instead of "NoneType" or update its type hint.
python:mypy_assignment (MINOR) source_hubspot/streams.py:203 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "str") . Code line: more_key: str = None
python:mypy_assignment (MINOR) source_hubspot/streams.py:226 Check that assigned value is compatible with target Incompatible default for argument "stream_state" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_state: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:227 Check that assigned value is compatible with target Incompatible default for argument "stream_slice" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_slice: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:228 Check that assigned value is compatible with target Incompatible default for argument "next_page_token" (default has type "None", argument has type "Mapping[str, Any]") . Code line: next_page_token: Mapping[str, Any] = None,
python:mypy_no_any_return (MINOR) source_hubspot/streams.py:230 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "str" . Code line: return self.url
python:mypy_assignment (MINOR) source_hubspot/streams.py:232 Check that assigned value is compatible with target Incompatible default for argument "start_date" (default has type "None", argument has type "str") . Code line: ... def init(self, api: API, start_date: str = None, credentials: Ma...
python:mypy_assignment (MINOR) source_hubspot/streams.py:232 Check that assigned value is compatible with target Incompatible default for argument "credentials" (default has type "None", argument has type "Mapping[str, Any]") . Code line: ...rt_date: str = None, credentials: Mapping[str, Any] = None, **kwargs):
python:mypy_attr_defined (MINOR) source_hubspot/streams.py:235 Check that attribute exists Module has no attribute "parse" . Code line: self._start_date = pendulum.parse(start_date)
python:mypy_return (MINOR) source_hubspot/streams.py:240 Check that function always returns a value Missing return statement . Code line: def backoff_time(self, response: requests.Response) -> Optional[fl...
python:mypy_assignment (MINOR) source_hubspot/streams.py:245 Check that assigned value is compatible with target Incompatible default for argument "stream_slice" (default has type "None", argument has type "Mapping[str, Any]") . Code line: ...ing[str, Any], stream_slice: Mapping[str, Any] = None, next_page_token...
python:mypy_assignment (MINOR) source_hubspot/streams.py:245 Check that assigned value is compatible with target Incompatible default for argument "next_page_token" (default has type "None", argument has type "Mapping[str, Any]") . Code line: ...e: Mapping[str, Any] = None, next_page_token: Mapping[str, Any] = None
python:mypy_no_any_return (MINOR) source_hubspot/streams.py:256 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 json_schema
python:mypy_assignment (MINOR) source_hubspot/streams.py:260 Check that assigned value is compatible with target Incompatible default for argument "stream_slice" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_slice: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:261 Check that assigned value is compatible with target Incompatible default for argument "stream_state" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_state: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:262 Check that assigned value is compatible with target Incompatible default for argument "next_page_token" (default has type "None", argument has type "Mapping[str, Any]") . Code line: next_page_token: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:263 Check that assigned value is compatible with target Incompatible default for argument "params" (default has type "None", argument has type "Mapping[str, Any]") . Code line: params: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:295 Check that assigned value is compatible with target Incompatible default for argument "stream_slice" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_slice: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:296 Check that assigned value is compatible with target Incompatible default for argument "stream_state" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_state: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:297 Check that assigned value is compatible with target Incompatible default for argument "next_page_token" (default has type "None", argument has type "Mapping[str, Any]") . Code line: next_page_token: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:326 Check that assigned value is compatible with target Incompatible default for argument "cursor_field" (default has type "None", argument has type "List[str]") . Code line: cursor_field: List[str] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:327 Check that assigned value is compatible with target Incompatible default for argument "stream_slice" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_slice: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:328 Check that assigned value is compatible with target Incompatible default for argument "stream_state" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_state: Mapping[str, Any] = None,
python:mypy_arg_type (MINOR) source_hubspot/streams.py:343 Check argument types in calls Argument "next_page_token" to "_read_stream_records" of "Stream" has incompatible type "None"; expected "Mapping[str, Any]" . Code line: next_page_token=next_page_token,
python:mypy_arg_type (MINOR) source_hubspot/streams.py:347 Check argument types in calls Argument "next_page_token" to "handle_request" of "Stream" has incompatible type "None"; expected "Mapping[str, Any]" . Code line: ...eam_slice, stream_state=stream_state, next_page_token=next_page_token)
python:mypy_assignment (MINOR) source_hubspot/streams.py:348 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "Iterable[Any]", variable has type "List[Any]") . Code line: records = self._transform(self.parse_response(resp...
python:mypy_valid_type (MINOR) source_hubspot/streams.py:351 Check that type (annotation) is valid Incompatible types in assignment (expression has type "Iterable[Any]", variable has type "List[Any]") [assignment] records = self._filter_old_records(records)
python:mypy_misc (MINOR) source_hubspot/streams.py:432 Miscellaneous other checks "None" not callable . Code line: casted_value = target_type(field_value)
python:mypy_valid_type (MINOR) source_hubspot/streams.py:439 Check that type (annotation) is valid Incompatible default for argument "properties" (default has type "None", argument has type "Mapping[str, Any]") [assignment] ...lf, record: Mapping, properties: Mapping[str, Any] = None) -> Mapping:
python:S5806 (MAJOR) source_hubspot/streams.py:450 Builtins should not be shadowed by local variables Rename this variable; it shadows a builtin.
python:mypy_assignment (MINOR) source_hubspot/streams.py:468 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "DateTime", variable has type "Union[int, str]") . Code line: value = pendulum.from_timestamp(value / 1000.0)
python:mypy_attr_defined (MINOR) source_hubspot/streams.py:470 Check that attribute exists Module has no attribute "parse" . Code line: value = pendulum.parse(value)
python:mypy_assignment (MINOR) source_hubspot/streams.py:488 Check that assigned value is compatible with target Incompatible default for argument "stream_slice" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_slice: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:489 Check that assigned value is compatible with target Incompatible default for argument "next_page_token" (default has type "None", argument has type "Mapping[str, Any]") . Code line: next_page_token: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:505 Check that assigned value is compatible with target Incompatible default for argument "stream_slice" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_slice: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:506 Check that assigned value is compatible with target Incompatible default for argument "next_page_token" (default has type "None", argument has type "Mapping[str, Any]") . Code line: next_page_token: Mapping[str, Any] = None,
python:S3776 (CRITICAL) source_hubspot/streams.py:538 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_return (MINOR) source_hubspot/streams.py:538 Check that function always returns a value Missing return statement . Code line: def next_page_token(self, response: requests.Response) -> Optional...
python:mypy_return_value (MINOR) source_hubspot/streams.py:547 Check that return value is compatible with signature Return value expected . Code line: return
python:mypy_assignment (MINOR) source_hubspot/streams.py:574 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", target has type "List[str]") . Code line: field_props["format"] = field_format
python:mypy_misc (MINOR) source_hubspot/streams.py:578 Miscellaneous other checks Decorated property not supported . Code line: @Property
python:mypy_no_any_return (MINOR) source_hubspot/streams.py:625 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Union[str, List[str]]" . Code line: return self.updated_at_field
python:mypy_assignment (MINOR) source_hubspot/streams.py:635 Check that assigned value is compatible with target Incompatible default for argument "cursor_field" (default has type "None", argument has type "List[str]") . Code line: cursor_field: List[str] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:636 Check that assigned value is compatible with target Incompatible default for argument "stream_slice" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_slice: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:637 Check that assigned value is compatible with target Incompatible default for argument "stream_state" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_state: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:690 Check that assigned value is compatible with target Incompatible default for argument "cursor_field" (default has type "None", argument has type "List[str]") . Code line: ..., sync_mode: SyncMode, cursor_field: List[str] = None, stream_state: M...
python:mypy_assignment (MINOR) source_hubspot/streams.py:690 Check that assigned value is compatible with target Incompatible default for argument "stream_state" (default has type "None", argument has type "Mapping[str, Any]") . Code line: ...cursor_field: List[str] = None, stream_state: Mapping[str, Any] = None
python:mypy_assignment (MINOR) source_hubspot/streams.py:698 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "int", variable has type "Duration") . Code line: chunk_size = int(chunk_size.total_seconds() * 1000) if self.ne...
python:mypy_call_overload (MINOR) source_hubspot/streams.py:700 Check that an overload variant matches arguments No overload variant of "range" matches argument types "int", "int", "Duration" . Code line: for ts in range(start_ts, now_ts, chunk_size):
python:mypy_assignment (MINOR) source_hubspot/streams.py:714 Check that assigned value is compatible with target Incompatible default for argument "stream_slice" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_slice: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:715 Check that assigned value is compatible with target Incompatible default for argument "next_page_token" (default has type "None", argument has type "Mapping[str, Any]") . Code line: next_page_token: Mapping[str, Any] = None,
python:S5890 (MAJOR) source_hubspot/streams.py:728 Values assigned to variables should match their type annotations Assign to "last_modified_field" a value of type "str" instead of "NoneType" or update its type hint.
python:mypy_assignment (MINOR) source_hubspot/streams.py:728 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "str") . Code line: last_modified_field: str = None
python:S5890 (MAJOR) source_hubspot/streams.py:729 Values assigned to variables should match their type annotations Assign to "associations" a value of type "list[str]" instead of "NoneType" or update its type hint.
python:mypy_assignment (MINOR) source_hubspot/streams.py:729 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "List[str]") . Code line: associations: List[str] = None
python:mypy_assignment (MINOR) source_hubspot/streams.py:747 Check that assigned value is compatible with target Incompatible default for argument "params" (default has type "None", argument has type "MutableMapping[str, Any]") . Code line: ... str, data: Mapping[str, Any], params: MutableMapping[str, Any] = None
python:mypy_assignment (MINOR) source_hubspot/streams.py:758 Check that assigned value is compatible with target Incompatible default for argument "stream_slice" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_slice: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:759 Check that assigned value is compatible with target Incompatible default for argument "stream_state" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_state: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:760 Check that assigned value is compatible with target Incompatible default for argument "next_page_token" (default has type "None", argument has type "Mapping[str, Any]") . Code line: next_page_token: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:784 Check that assigned value is compatible with target Incompatible default for argument "cursor_field" (default has type "None", argument has type "List[str]") . Code line: cursor_field: List[str] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:785 Check that assigned value is compatible with target Incompatible default for argument "stream_slice" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_slice: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:786 Check that assigned value is compatible with target Incompatible default for argument "stream_state" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_state: Mapping[str, Any] = None,
python:mypy_attr_defined (MINOR) source_hubspot/streams.py:795 Check that attribute exists "_lru_cache_wrapper[Mapping[str, Any]]" has no attribute "keys" . Code line: properties_list = list(self.properties.keys())
python:mypy_arg_type (MINOR) source_hubspot/streams.py:800 Check argument types in calls Argument "next_page_token" to "_process_search" of "CRMSearchStream" has incompatible type "None"; expected "Mapping[str, Any]" . Code line: next_page_token=next_page_token,
python:mypy_arg_type (MINOR) source_hubspot/streams.py:810 Check argument types in calls Argument "next_page_token" to "_read_stream_records" of "Stream" has incompatible type "None"; expected "Mapping[str, Any]" . Code line: next_page_token=next_page_token,
python:mypy_assignment (MINOR) source_hubspot/streams.py:814 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "Iterable[Any]", variable has type "List[Any]") . Code line: records = self._filter_old_records(records)
python:mypy_assignment (MINOR) source_hubspot/streams.py:815 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "Iterable[MutableMapping[Any, Any]]", variable has type "List[Any]") . Code line: records = self._flat_associations(records)
python:mypy_assignment (MINOR) source_hubspot/streams.py:833 Check that assigned value is compatible with target Incompatible default for argument "stream_slice" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_slice: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:834 Check that assigned value is compatible with target Incompatible default for argument "next_page_token" (default has type "None", argument has type "Mapping[str, Any]") . Code line: next_page_token: Mapping[str, Any] = None,
python:mypy_return (MINOR) source_hubspot/streams.py:841 Check that function always returns a value Missing return statement . Code line: def next_page_token(self, response: requests.Response) -> Optional...
python:mypy_assignment (MINOR) source_hubspot/streams.py:862 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "Optional[str]", base class "Stream" defined the type as "str") . Code line: entity: Optional[str] = None
python:mypy_assignment (MINOR) source_hubspot/streams.py:891 Check that assigned value is compatible with target Incompatible default for argument "stream_slice" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_slice: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:892 Check that assigned value is compatible with target Incompatible default for argument "next_page_token" (default has type "None", argument has type "Mapping[str, Any]") . Code line: next_page_token: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:908 Check that assigned value is compatible with target Incompatible default for argument "cursor_field" (default has type "None", argument has type "List[str]") . Code line: cursor_field: List[str] = None,
python:mypy_return (MINOR) source_hubspot/streams.py:362 Check that function always returns a value Missing return statement . Code line: def _convert_datetime_to_string(dt: pendulum.datetime, declared_fo...
python:mypy_assignment (MINOR) source_hubspot/streams.py:362 Check that assigned value is compatible with target Incompatible default for argument "declared_format" (default has type "None", argument has type "str") . Code line: ..._to_string(dt: pendulum.datetime, declared_format: str = None) -> str:
python:mypy_no_any_return (MINOR) source_hubspot/streams.py:364 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "str" . Code line: return dt.to_date_string()
python:mypy_attr_defined (MINOR) source_hubspot/streams.py:364 Check that attribute exists pendulum.datetime? has no attribute "to_date_string" . Code line: return dt.to_date_string()
python:mypy_no_any_return (MINOR) source_hubspot/streams.py:366 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "str" . Code line: return dt.to_datetime_string()
python:mypy_attr_defined (MINOR) source_hubspot/streams.py:366 Check that attribute exists pendulum.datetime? has no attribute "to_datetime_string" . Code line: return dt.to_datetime_string()
python:mypy_assignment (MINOR) source_hubspot/streams.py:369 Check that assigned value is compatible with target Incompatible default for argument "declared_format" (default has type "None", argument has type "str") . Code line: ...ield_name: str, field_value: Any, declared_format: str = None) -> Any:
python:mypy_attr_defined (MINOR) source_hubspot/streams.py:377 Check that attribute exists Module has no attribute "parse" . Code line: dt = pendulum.parse(field_value)
python:mypy_assignment (MINOR) source_hubspot/streams.py:393 Check that assigned value is compatible with target Incompatible default for argument "declared_format" (default has type "None", argument has type "str") . Code line: ...ield_name: str, field_value: Any, declared_format: str = None) -> Any:
python:mypy_import (MINOR) source_hubspot/source.py:15 Require that imported module can be found or has stubs Library stubs not installed for "requests" (or incompatible with Python 3.7) . Code line: from requests import HTTPError
python:mypy_assignment (MINOR) source_hubspot/source.py:117 Check that assigned value is compatible with target Incompatible default for argument "state" (default has type "None", argument has type "MutableMapping[str, Any]") . Code line: ...alog: ConfiguredAirbyteCatalog, state: MutableMapping[str, Any] = None
python:mypy_import (MINOR) source_hubspot/streams.py:16 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_var_annotated (MINOR) source_hubspot/streams.py:63 Require variable annotation if type can't be inferred Need type annotation for "local_properties" (hint: "local_properties: List[] = ...") . Code line: local_properties = []
python:mypy_misc (MINOR) source_hubspot/streams.py:66 Miscellaneous other checks Incompatible types in "yield" (actual type "List[Any]", expected type "Tuple[str]") . Code line: yield local_properties
python:mypy_misc (MINOR) source_hubspot/streams.py:74 Miscellaneous other checks Incompatible types in "yield" (actual type "List[str]", expected type "Tuple[str]") . Code line: yield local_properties
python:S112 (MAJOR) source_hubspot/streams.py:148 "Exception" and "BaseException" should not be raised Replace this generic exception class with a more specific one.
python:mypy_no_any_return (MINOR) source_hubspot/streams.py:179 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Union[MutableMapping[str, Any], List[MutableMapping[str, Any]]]" . Code line: return response.json()
python:mypy_assignment (MINOR) source_hubspot/streams.py:184 Check that assigned value is compatible with target Incompatible default for argument "params" (default has type "None", argument has type "MutableMapping[str, Any]") . Code line: self, url: str, params: MutableMapping[str, Any] = None
python:mypy_assignment (MINOR) source_hubspot/streams.py:190 Check that assigned value is compatible with target Incompatible default for argument "params" (default has type "None", argument has type "MutableMapping[str, Any]") . Code line: ... str, data: Mapping[str, Any], params: MutableMapping[str, Any] = None
python:mypy_return_value (MINOR) source_hubspot/streams.py:193 Check that return value is compatible with signature Incompatible return value type (got "Tuple[Union[MutableMapping[str, Any], List[MutableMapping[str, Any]]], Any]", expected "Tuple[Union[Mapping[str, Any], List[Mapping[str, Any]]], Any]") . Code line: return self._parse_and_handle_errors(response), response
python:S5890 (MAJOR) source_hubspot/streams.py:199 Values assigned to variables should match their type annotations Assign to "entity" a value of type "str" instead of "NoneType" or update its type hint.
python:mypy_assignment (MINOR) source_hubspot/streams.py:199 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "str") . Code line: entity: str = None
python:S5890 (MAJOR) source_hubspot/streams.py:200 Values assigned to variables should match their type annotations Assign to "updated_at_field" a value of type "str" instead of "NoneType" or update its type hint.
python:mypy_assignment (MINOR) source_hubspot/streams.py:200 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "str") . Code line: updated_at_field: str = None
python:S5890 (MAJOR) source_hubspot/streams.py:201 Values assigned to variables should match their type annotations Assign to "created_at_field" a value of type "str" instead of "NoneType" or update its type hint.
python:mypy_assignment (MINOR) source_hubspot/streams.py:201 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "str") . Code line: created_at_field: str = None
python:S5890 (MAJOR) source_hubspot/streams.py:203 Values assigned to variables should match their type annotations Assign to "more_key" a value of type "str" instead of "NoneType" or update its type hint.
python:mypy_assignment (MINOR) source_hubspot/streams.py:203 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "str") . Code line: more_key: str = None
python:mypy_assignment (MINOR) source_hubspot/streams.py:226 Check that assigned value is compatible with target Incompatible default for argument "stream_state" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_state: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:227 Check that assigned value is compatible with target Incompatible default for argument "stream_slice" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_slice: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:228 Check that assigned value is compatible with target Incompatible default for argument "next_page_token" (default has type "None", argument has type "Mapping[str, Any]") . Code line: next_page_token: Mapping[str, Any] = None,
python:mypy_no_any_return (MINOR) source_hubspot/streams.py:230 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "str" . Code line: return self.url
python:mypy_assignment (MINOR) source_hubspot/streams.py:232 Check that assigned value is compatible with target Incompatible default for argument "start_date" (default has type "None", argument has type "str") . Code line: ... def init(self, api: API, start_date: str = None, credentials: Ma...
python:mypy_assignment (MINOR) source_hubspot/streams.py:232 Check that assigned value is compatible with target Incompatible default for argument "credentials" (default has type "None", argument has type "Mapping[str, Any]") . Code line: ...rt_date: str = None, credentials: Mapping[str, Any] = None, **kwargs):
python:mypy_attr_defined (MINOR) source_hubspot/streams.py:235 Check that attribute exists Module has no attribute "parse" . Code line: self._start_date = pendulum.parse(start_date)
python:mypy_return (MINOR) source_hubspot/streams.py:240 Check that function always returns a value Missing return statement . Code line: def backoff_time(self, response: requests.Response) -> Optional[fl...
python:mypy_assignment (MINOR) source_hubspot/streams.py:245 Check that assigned value is compatible with target Incompatible default for argument "stream_slice" (default has type "None", argument has type "Mapping[str, Any]") . Code line: ...ing[str, Any], stream_slice: Mapping[str, Any] = None, next_page_token...
python:mypy_assignment (MINOR) source_hubspot/streams.py:245 Check that assigned value is compatible with target Incompatible default for argument "next_page_token" (default has type "None", argument has type "Mapping[str, Any]") . Code line: ...e: Mapping[str, Any] = None, next_page_token: Mapping[str, Any] = None
python:mypy_no_any_return (MINOR) source_hubspot/streams.py:256 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 json_schema
python:mypy_assignment (MINOR) source_hubspot/streams.py:260 Check that assigned value is compatible with target Incompatible default for argument "stream_slice" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_slice: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:261 Check that assigned value is compatible with target Incompatible default for argument "stream_state" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_state: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:262 Check that assigned value is compatible with target Incompatible default for argument "next_page_token" (default has type "None", argument has type "Mapping[str, Any]") . Code line: next_page_token: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:263 Check that assigned value is compatible with target Incompatible default for argument "params" (default has type "None", argument has type "Mapping[str, Any]") . Code line: params: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:295 Check that assigned value is compatible with target Incompatible default for argument "stream_slice" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_slice: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:296 Check that assigned value is compatible with target Incompatible default for argument "stream_state" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_state: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:297 Check that assigned value is compatible with target Incompatible default for argument "next_page_token" (default has type "None", argument has type "Mapping[str, Any]") . Code line: next_page_token: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:326 Check that assigned value is compatible with target Incompatible default for argument "cursor_field" (default has type "None", argument has type "List[str]") . Code line: cursor_field: List[str] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:327 Check that assigned value is compatible with target Incompatible default for argument "stream_slice" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_slice: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:328 Check that assigned value is compatible with target Incompatible default for argument "stream_state" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_state: Mapping[str, Any] = None,
python:mypy_arg_type (MINOR) source_hubspot/streams.py:343 Check argument types in calls Argument "next_page_token" to "_read_stream_records" of "Stream" has incompatible type "None"; expected "Mapping[str, Any]" . Code line: next_page_token=next_page_token,
python:mypy_arg_type (MINOR) source_hubspot/streams.py:347 Check argument types in calls Argument "next_page_token" to "handle_request" of "Stream" has incompatible type "None"; expected "Mapping[str, Any]" . Code line: ...eam_slice, stream_state=stream_state, next_page_token=next_page_token)
python:mypy_assignment (MINOR) source_hubspot/streams.py:348 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "Iterable[Any]", variable has type "List[Any]") . Code line: records = self._transform(self.parse_response(resp...
python:mypy_valid_type (MINOR) source_hubspot/streams.py:351 Check that type (annotation) is valid Incompatible types in assignment (expression has type "Iterable[Any]", variable has type "List[Any]") [assignment] records = self._filter_old_records(records)
python:mypy_misc (MINOR) source_hubspot/streams.py:432 Miscellaneous other checks "None" not callable . Code line: casted_value = target_type(field_value)
python:mypy_valid_type (MINOR) source_hubspot/streams.py:439 Check that type (annotation) is valid Incompatible default for argument "properties" (default has type "None", argument has type "Mapping[str, Any]") [assignment] ...lf, record: Mapping, properties: Mapping[str, Any] = None) -> Mapping:
python:S5806 (MAJOR) source_hubspot/streams.py:450 Builtins should not be shadowed by local variables Rename this variable; it shadows a builtin.
python:mypy_assignment (MINOR) source_hubspot/streams.py:468 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "DateTime", variable has type "Union[int, str]") . Code line: value = pendulum.from_timestamp(value / 1000.0)
python:mypy_attr_defined (MINOR) source_hubspot/streams.py:470 Check that attribute exists Module has no attribute "parse" . Code line: value = pendulum.parse(value)
python:mypy_assignment (MINOR) source_hubspot/streams.py:488 Check that assigned value is compatible with target Incompatible default for argument "stream_slice" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_slice: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:489 Check that assigned value is compatible with target Incompatible default for argument "next_page_token" (default has type "None", argument has type "Mapping[str, Any]") . Code line: next_page_token: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:505 Check that assigned value is compatible with target Incompatible default for argument "stream_slice" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_slice: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:506 Check that assigned value is compatible with target Incompatible default for argument "next_page_token" (default has type "None", argument has type "Mapping[str, Any]") . Code line: next_page_token: Mapping[str, Any] = None,
python:S3776 (CRITICAL) source_hubspot/streams.py:538 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_return (MINOR) source_hubspot/streams.py:538 Check that function always returns a value Missing return statement . Code line: def next_page_token(self, response: requests.Response) -> Optional...
python:mypy_return_value (MINOR) source_hubspot/streams.py:547 Check that return value is compatible with signature Return value expected . Code line: return
python:mypy_assignment (MINOR) source_hubspot/streams.py:574 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", target has type "List[str]") . Code line: field_props["format"] = field_format
python:mypy_misc (MINOR) source_hubspot/streams.py:578 Miscellaneous other checks Decorated property not supported . Code line: @Property
python:mypy_no_any_return (MINOR) source_hubspot/streams.py:625 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Union[str, List[str]]" . Code line: return self.updated_at_field
python:mypy_assignment (MINOR) source_hubspot/streams.py:635 Check that assigned value is compatible with target Incompatible default for argument "cursor_field" (default has type "None", argument has type "List[str]") . Code line: cursor_field: List[str] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:636 Check that assigned value is compatible with target Incompatible default for argument "stream_slice" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_slice: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:637 Check that assigned value is compatible with target Incompatible default for argument "stream_state" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_state: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:690 Check that assigned value is compatible with target Incompatible default for argument "cursor_field" (default has type "None", argument has type "List[str]") . Code line: ..., sync_mode: SyncMode, cursor_field: List[str] = None, stream_state: M...
python:mypy_assignment (MINOR) source_hubspot/streams.py:690 Check that assigned value is compatible with target Incompatible default for argument "stream_state" (default has type "None", argument has type "Mapping[str, Any]") . Code line: ...cursor_field: List[str] = None, stream_state: Mapping[str, Any] = None
python:mypy_assignment (MINOR) source_hubspot/streams.py:698 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "int", variable has type "Duration") . Code line: chunk_size = int(chunk_size.total_seconds() * 1000) if self.ne...
python:mypy_call_overload (MINOR) source_hubspot/streams.py:700 Check that an overload variant matches arguments No overload variant of "range" matches argument types "int", "int", "Duration" . Code line: for ts in range(start_ts, now_ts, chunk_size):
python:mypy_assignment (MINOR) source_hubspot/streams.py:714 Check that assigned value is compatible with target Incompatible default for argument "stream_slice" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_slice: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:715 Check that assigned value is compatible with target Incompatible default for argument "next_page_token" (default has type "None", argument has type "Mapping[str, Any]") . Code line: next_page_token: Mapping[str, Any] = None,
python:S5890 (MAJOR) source_hubspot/streams.py:728 Values assigned to variables should match their type annotations Assign to "last_modified_field" a value of type "str" instead of "NoneType" or update its type hint.
python:mypy_assignment (MINOR) source_hubspot/streams.py:728 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "str") . Code line: last_modified_field: str = None
python:S5890 (MAJOR) source_hubspot/streams.py:729 Values assigned to variables should match their type annotations Assign to "associations" a value of type "list[str]" instead of "NoneType" or update its type hint.
python:mypy_assignment (MINOR) source_hubspot/streams.py:729 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "List[str]") . Code line: associations: List[str] = None
python:mypy_assignment (MINOR) source_hubspot/streams.py:747 Check that assigned value is compatible with target Incompatible default for argument "params" (default has type "None", argument has type "MutableMapping[str, Any]") . Code line: ... str, data: Mapping[str, Any], params: MutableMapping[str, Any] = None
python:mypy_assignment (MINOR) source_hubspot/streams.py:758 Check that assigned value is compatible with target Incompatible default for argument "stream_slice" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_slice: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:759 Check that assigned value is compatible with target Incompatible default for argument "stream_state" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_state: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:760 Check that assigned value is compatible with target Incompatible default for argument "next_page_token" (default has type "None", argument has type "Mapping[str, Any]") . Code line: next_page_token: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:784 Check that assigned value is compatible with target Incompatible default for argument "cursor_field" (default has type "None", argument has type "List[str]") . Code line: cursor_field: List[str] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:785 Check that assigned value is compatible with target Incompatible default for argument "stream_slice" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_slice: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:786 Check that assigned value is compatible with target Incompatible default for argument "stream_state" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_state: Mapping[str, Any] = None,
python:mypy_attr_defined (MINOR) source_hubspot/streams.py:795 Check that attribute exists "_lru_cache_wrapper[Mapping[str, Any]]" has no attribute "keys" . Code line: properties_list = list(self.properties.keys())
python:mypy_arg_type (MINOR) source_hubspot/streams.py:800 Check argument types in calls Argument "next_page_token" to "_process_search" of "CRMSearchStream" has incompatible type "None"; expected "Mapping[str, Any]" . Code line: next_page_token=next_page_token,
python:mypy_arg_type (MINOR) source_hubspot/streams.py:810 Check argument types in calls Argument "next_page_token" to "_read_stream_records" of "Stream" has incompatible type "None"; expected "Mapping[str, Any]" . Code line: next_page_token=next_page_token,
python:mypy_assignment (MINOR) source_hubspot/streams.py:814 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "Iterable[Any]", variable has type "List[Any]") . Code line: records = self._filter_old_records(records)
python:mypy_assignment (MINOR) source_hubspot/streams.py:815 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "Iterable[MutableMapping[Any, Any]]", variable has type "List[Any]") . Code line: records = self._flat_associations(records)
python:mypy_assignment (MINOR) source_hubspot/streams.py:833 Check that assigned value is compatible with target Incompatible default for argument "stream_slice" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_slice: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:834 Check that assigned value is compatible with target Incompatible default for argument "next_page_token" (default has type "None", argument has type "Mapping[str, Any]") . Code line: next_page_token: Mapping[str, Any] = None,
python:mypy_return (MINOR) source_hubspot/streams.py:841 Check that function always returns a value Missing return statement . Code line: def next_page_token(self, response: requests.Response) -> Optional...
python:mypy_assignment (MINOR) source_hubspot/streams.py:862 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "Optional[str]", base class "Stream" defined the type as "str") . Code line: entity: Optional[str] = None
python:mypy_assignment (MINOR) source_hubspot/streams.py:891 Check that assigned value is compatible with target Incompatible default for argument "stream_slice" (default has type "None", argument has type "Mapping[str, Any]") . Code line: stream_slice: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:892 Check that assigned value is compatible with target Incompatible default for argument "next_page_token" (default has type "None", argument has type "Mapping[str, Any]") . Code line: next_page_token: Mapping[str, Any] = None,
python:mypy_assignment (MINOR) source_hubspot/streams.py:908 Check that assigned value is compatible with target Incompatible default for argument "cursor_field" (default has type "None", argument has type "List[str]") . Code line: cursor_field: List[str] = None,

Coverage (81.3%)

File Coverage File Coverage
source_hubspot/init.py 100.0 source_hubspot/errors.py 100.0
source_hubspot/source.py 76.8 source_hubspot/streams.py 81.5

Please sign in to comment.