Skip to content

Commit

Permalink
added schedules stream to SAT tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bazarnov committed Mar 25, 2022
1 parent 108ce1a commit bbd1ef6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,18 @@
"sync_mode": "incremental",
"destination_sync_mode": "append"
},
{
"stream": {
"name": "schedules",
"json_schema": {},
"supported_sync_modes": ["full_refresh"],
"source_defined_cursor": false,
"default_cursor_field": [],
"source_defined_primary_key": [["id"]]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "sla_policies",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ class SourceZendeskSupportFullRefreshStream(BaseSourceZendeskSupportStream):
# thus we can't implement an incremental logic for them
"""

page_size = 100
primary_key = "id"
response_list_name: str = None

Expand Down

1 comment on commit bbd1ef6

@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 Zendesk Support(#11349)

Measures

Name Value Name Value Name Value
Bugs 0 Vulnerabilities 0 Code Smells 55
Duplicated Blocks 0 Duplicated Lines (%) 0.0 Reliability Rating A
Lines of Code 440 Coverage 100.0 Lines to Cover 1
Security Rating A Quality Gate Status OK Blocker Issues 0
Critical Issues 0 Major Issues 16 Minor Issues 39

Detected Issues

Rule File Description Message
python:black_need_format (MINOR) source_zendesk_support/streams.py Please run one of the commands: "black --config ./pyproject.toml <path_to_updated_folder>" or "./gradlew format" 2 code part(s) should be updated.
python:mypy_arg_type (MINOR) source_zendesk_support/streams.py:344 Check argument types in calls Argument 1 to "int" has incompatible type "Optional[str]"; expected "Union[str, bytes, SupportsInt, SupportsIndex, SupportsTrunc]" . Code line: return {self.cursor_field: int(start_time)}
flake8:W293 (MAJOR) source_zendesk_support/streams.py:381 blank line contains whitespace blank line contains whitespace
flake8:W291 (MAJOR) source_zendesk_support/streams.py:383 trailing whitespace trailing whitespace
python:S5890 (MAJOR) source_zendesk_support/streams.py:424 Values assigned to variables should match their type annotations Assign to "list_entities_from_event" a value of type "list[str]" instead of "NoneType" or update its type hint.
python:mypy_assignment (MINOR) source_zendesk_support/streams.py:424 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "List[str]") . Code line: list_entities_from_event: List[str] = None
python:S5890 (MAJOR) source_zendesk_support/streams.py:425 Values assigned to variables should match their type annotations Assign to "event_type" a value of type "str" instead of "NoneType" or update its type hint.
python:mypy_assignment (MINOR) source_zendesk_support/streams.py:425 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "str") . Code line: event_type: str = None
flake8:W293 (MAJOR) source_zendesk_support/streams.py:431 blank line contains whitespace blank line contains whitespace
python:mypy_override (MINOR) source_zendesk_support/streams.py:432 Check that method override is compatible with base class Signature of "parse_response" incompatible with supertype "BaseSourceZendeskSupportStream" . Code line: def parse_response(self, response: requests.Response, **kwargs) ->...
python:mypy_return_value (MINOR) source_zendesk_support/streams.py:122 Check that return value is compatible with signature Incompatible return value type (got "Optional[str]", expected "Optional[int]") . Code line: return dict(parse_qsl(urlparse(next_page).query)).get("page") ...
python:mypy_override (MINOR) source_zendesk_support/streams.py:346 Check that method override is compatible with base class Signature of "request_params" incompatible with supertype "SourceZendeskSupportFullRefreshStream" . Code line: def request_params(
python:mypy_attr_defined (MINOR) source_zendesk_support/streams.py:352 Check that attribute exists Module has no attribute "parse" . Code line: parsed_state = calendar.timegm(pendulum.parse(stream_state...
python:mypy_attr_defined (MINOR) source_zendesk_support/streams.py:355 Check that attribute exists Module has no attribute "parse" . Code line: parsed_state = calendar.timegm(pendulum.parse(self.start...
flake8:W293 (MAJOR) source_zendesk_support/streams.py:371 blank line contains whitespace blank line contains whitespace
python:mypy_assignment (MINOR) source_zendesk_support/streams.py:374 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "str") . Code line: sideload_param: str = None
python:S5890 (MAJOR) source_zendesk_support/streams.py:374 Values assigned to variables should match their type annotations Assign to "sideload_param" a value of type "str" instead of "NoneType" or update its type hint.
flake8:W293 (MAJOR) source_zendesk_support/streams.py:375 blank line contains whitespace blank line contains whitespace
flake8:W293 (MAJOR) source_zendesk_support/streams.py:386 blank line contains whitespace blank line contains whitespace
flake8:W293 (MAJOR) source_zendesk_support/streams.py:389 blank line contains whitespace blank line contains whitespace
flake8:W293 (MAJOR) source_zendesk_support/streams.py:396 blank line contains whitespace blank line contains whitespace
python:mypy_override (MINOR) source_zendesk_support/streams.py:397 Check that method override is compatible with base class Signature of "request_params" incompatible with supertype "SourceZendeskSupportFullRefreshStream" . Code line: def request_params(
flake8:W293 (MAJOR) source_zendesk_support/streams.py:406 blank line contains whitespace blank line contains whitespace
python:mypy_override (MINOR) source_zendesk_support/streams.py:407 Check that method override is compatible with base class Signature of "parse_response" incompatible with supertype "BaseSourceZendeskSupportStream" . Code line: def parse_response(self, response: requests.Response, **kwargs) ->...
python:S1066 (MAJOR) source_zendesk_support/source.py:58 Collapsible "if" statements should be merged Merge this if statement with the enclosing one.
python:mypy_no_any_return (MINOR) source_zendesk_support/source.py:64 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "BasicApiTokenAuthenticator" . Code line: return TokenAuthenticator(token=config["credentials"][...
python:mypy_arg_type (MINOR) source_zendesk_support/source.py:81 Check argument types in calls Argument "start_date" to "UserSettingsStream" has incompatible type "None"; expected "str" . Code line: ...nfig["subdomain"], authenticator=auth, start_date=None).get_settings()
python:mypy_import (MINOR) source_zendesk_support/streams.py:25 Require that imported module can be found or has stubs Library stubs not installed for "requests.auth" (or incompatible with Python 3.7) . Code line: from requests.auth import AuthBase
python:mypy_no_any_return (MINOR) source_zendesk_support/streams.py:62 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Future[Any]" . Code line: return self.executor.submit(func, request, **kwargs)
python:S5890 (MAJOR) source_zendesk_support/streams.py:146 Values assigned to variables should match their type annotations Assign to "response_list_name" a value of type "str" instead of "NoneType" or update its type hint.
python:mypy_assignment (MINOR) source_zendesk_support/streams.py:146 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "str") . Code line: response_list_name: str = None
python:mypy_assignment (MINOR) source_zendesk_support/streams.py:147 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "SourceZendeskSupportStream") . Code line: parent: "SourceZendeskSupportStream" = None
python:mypy_assignment (MINOR) source_zendesk_support/streams.py:148 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "deque[Any]") . Code line: future_requests: deque = None
python:mypy_assignment (MINOR) source_zendesk_support/streams.py:186 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "Optional[Any]", variable has type "str") . Code line: start_date = stream_state.get(self.cursor_field)
python:mypy_attr_defined (MINOR) source_zendesk_support/streams.py:245 Check that attribute exists Module has no attribute "parse" . Code line: ... start_time = current_state or calendar.timegm(pendulum.parse(self._...
python:mypy_arg_type (MINOR) source_zendesk_support/streams.py:288 Check argument types in calls Argument "stream_state" to "parse_response" of "BaseSourceZendeskSupportStream" has incompatible type "Optional[Mapping[str, Any]]"; expected "Mapping[str, Any]" . Code line: ... from self.parse_response(response, stream_state=stream_state, stream_...
python:mypy_assignment (MINOR) source_zendesk_support/streams.py:299 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "str") . Code line: response_list_name: str = None
python:S5890 (MAJOR) source_zendesk_support/streams.py:299 Values assigned to variables should match their type annotations Assign to "response_list_name" a value of type "str" instead of "NoneType" or update its type hint.
python:mypy_return (MINOR) source_zendesk_support/streams.py:340 Check that function always returns a value Missing return statement . Code line: def next_page_token(self, response: requests.Response) -> Optional...
python:mypy_attr_defined (MINOR) source_zendesk_support/streams.py:359 Check that attribute exists Module has no attribute "parse" . Code line: ... params = {"start_time": calendar.timegm(pendulum.parse(self._...
python:mypy_override (MINOR) source_zendesk_support/streams.py:586 Check that method override is compatible with base class Signature of "parse_response" incompatible with supertype "BaseSourceZendeskSupportStream" . Code line: def parse_response(self, response: requests.Response, **kwargs) ->...
python:mypy_no_any_return (MINOR) source_zendesk_support/streams.py:594 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 resp
python:mypy_override (MINOR) source_zendesk_support/streams.py:536 Check that method override is compatible with base class Signature of "request_params" incompatible with supertype "SourceZendeskSupportCursorPaginationStream" . Code line: def request_params(self, next_page_token: Mapping[str, Any] = None...
python:mypy_no_any_return (MINOR) source_zendesk_support/streams.py:544 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Optional[Mapping[str, Any]]" . Code line: return response.json().get("before_cursor")
python:mypy_arg_type (MINOR) source_zendesk_support/streams.py:485 Check argument types in calls Argument 1 to "str2unixtime" of "BaseSourceZendeskSupportStream" has incompatible type "Optional[Any]"; expected "str" . Code line: start_time = self.str2unixtime((stream_state or {}).get(self.c...
python:mypy_no_any_return (MINOR) source_zendesk_support/streams.py:89 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Union[int, float]" . Code line: return super().backoff_time(response)
python:mypy_import (MINOR) source_zendesk_support/source.py:8 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_return (MINOR) source_zendesk_support/source.py:53 Check that function always returns a value Missing return statement . Code line: def get_authenticator(cls, config: Mapping[str, Any]) -> BasicApiT...
python:mypy_valid_type (MINOR) source_zendesk_support/source.py:70 Check that type (annotation) is valid Function "builtins.any" is not valid as a type . Code line: def check_connection(self, logger, config) -> Tuple[bool, any]:
python:mypy_import (MINOR) source_zendesk_support/streams.py:18 Require that imported module can be found or has stubs Library stubs not installed for "pytz" (or incompatible with Python 3.7) . Code line: import pytz
python:mypy_import (MINOR) source_zendesk_support/streams.py:19 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:S5886 (MAJOR) source_zendesk_support/streams.py:97 Function return types should be consistent with their type hint Return a value of type "datetime" instead of "NoneType" or update function "str2datetime" type hint.
python:mypy_return_value (MINOR) source_zendesk_support/streams.py:97 Check that return value is compatible with signature Incompatible return value type (got "None", expected "datetime") . Code line: return None
python:mypy_return_value (MINOR) source_zendesk_support/streams.py:313 Check that return value is compatible with signature Incompatible return value type (got "int", expected "Optional[Mapping[str, Any]]") . Code line: return next_page
python:mypy_no_any_return (MINOR) source_zendesk_support/streams.py:323 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

Coverage (100.0%)

File Coverage File Coverage
source_zendesk_support/init.py 100.0 source_zendesk_support/source.py 44.4
source_zendesk_support/streams.py 80.5

Please sign in to comment.