Skip to content

Commit

Permalink
Merge branch 'master' into brian/mock_sleep_to_speedup_tests
Browse files Browse the repository at this point in the history
  • Loading branch information
brianjlai committed Apr 28, 2022
2 parents b8047de + e0902e6 commit 4168e8f
Show file tree
Hide file tree
Showing 262 changed files with 5,227 additions and 1,498 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.36.3-alpha
current_version = 0.36.4-alpha
commit = False
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-[a-z]+)?
Expand Down
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


### SHARED ###
VERSION=0.36.3-alpha
VERSION=0.36.4-alpha

# When using the airbyte-db via default docker image
CONFIG_ROOT=/data
Expand Down Expand Up @@ -40,7 +40,7 @@ DATABASE_PASSWORD=docker
DATABASE_HOST=db
DATABASE_PORT=5432
DATABASE_DB=airbyte
# translate manually DATABASE_URL=jdbc:postgresql://${DATABASE_HOST}:${DATABASE_PORT/${DATABASE_DB} (do not include the username or password here)
# translate manually DATABASE_URL=jdbc:postgresql://${DATABASE_HOST}:${DATABASE_PORT}/${DATABASE_DB} (do not include the username or password here)
DATABASE_URL=jdbc:postgresql://db:5432/airbyte
JOBS_DATABASE_MINIMUM_FLYWAY_MIGRATION_VERSION=0.29.15.001

Expand Down
37 changes: 0 additions & 37 deletions .github/workflows/documentation.yml

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/publish-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ jobs:
run: |
git add -u
git commit -m "auto-bump connector version"
git pull origin ${{ github.event.inputs.gitref }}
git push origin ${{ github.event.inputs.gitref }}
- name: Add Version Bump Success Comment
if: github.event.inputs.comment-id && github.event.inputs.auto-bump-version == 'true' && success()
Expand Down
1 change: 0 additions & 1 deletion airbyte-api/src/main/openapi/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3143,7 +3143,6 @@ components:
WebBackendConnectionCreate:
type: object
required:
- connection
- sourceId
- destinationId
- status
Expand Down
2 changes: 1 addition & 1 deletion airbyte-bootloader/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG JDK_VERSION=17.0.1
FROM openjdk:${JDK_VERSION}-slim

ARG VERSION=0.36.3-alpha
ARG VERSION=0.36.4-alpha

ENV APPLICATION airbyte-bootloader
ENV VERSION ${VERSION}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void testBootloaderAppBlankDb() throws Exception {
mockedConfigs.getConfigDatabaseUrl())
.getAndInitialize();
val configsMigrator = new ConfigsDatabaseMigrator(configDatabase, this.getClass().getName());
assertEquals("0.35.59.004", configsMigrator.getLatestMigration().getVersion().getVersion());
assertEquals("0.35.65.001", configsMigrator.getLatestMigration().getVersion().getVersion());

val jobsPersistence = new DefaultJobPersistence(jobDatabase);
assertEquals(version, jobsPersistence.getVersion().get());
Expand Down
19 changes: 19 additions & 0 deletions airbyte-config/init/src/main/resources/icons/tidb.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
- name: Clickhouse
destinationDefinitionId: ce0d828e-1dc4-496c-b122-2da42e637e48
dockerRepository: airbyte/destination-clickhouse
dockerImageTag: 0.1.4
dockerImageTag: 0.1.5
documentationUrl: https://docs.airbyte.io/integrations/destinations/clickhouse
- name: DynamoDB
destinationDefinitionId: 8ccd8909-4e99-4141-b48d-4984b70b2d89
Expand Down Expand Up @@ -137,7 +137,7 @@
- name: MS SQL Server
destinationDefinitionId: d4353156-9217-4cad-8dd7-c108fd4f74cf
dockerRepository: airbyte/destination-mssql
dockerImageTag: 0.1.16
dockerImageTag: 0.1.17
documentationUrl: https://docs.airbyte.io/integrations/destinations/mssql
icon: mssql.svg
- name: MeiliSearch
Expand All @@ -161,13 +161,13 @@
- name: Oracle
destinationDefinitionId: 3986776d-2319-4de9-8af8-db14c0996e72
dockerRepository: airbyte/destination-oracle
dockerImageTag: 0.1.15
dockerImageTag: 0.1.16
documentationUrl: https://docs.airbyte.io/integrations/destinations/oracle
icon: oracle.svg
- name: Postgres
destinationDefinitionId: 25c5221d-dce2-4163-ade9-739ef790f503
dockerRepository: airbyte/destination-postgres
dockerImageTag: 0.3.18
dockerImageTag: 0.3.19
documentationUrl: https://docs.airbyte.io/integrations/destinations/postgres
icon: postgresql.svg
- name: Pulsar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@
supported_destination_sync_modes:
- "overwrite"
- "append"
- dockerImage: "airbyte/destination-clickhouse:0.1.4"
- dockerImage: "airbyte/destination-clickhouse:0.1.5"
spec:
documentationUrl: "https://docs.airbyte.io/integrations/destinations/clickhouse"
connectionSpecification:
Expand Down Expand Up @@ -2267,7 +2267,7 @@
supportsDBT: false
supported_destination_sync_modes:
- "append"
- dockerImage: "airbyte/destination-mssql:0.1.16"
- dockerImage: "airbyte/destination-mssql:0.1.17"
spec:
documentationUrl: "https://docs.airbyte.io/integrations/destinations/mssql"
connectionSpecification:
Expand Down Expand Up @@ -2819,7 +2819,7 @@
supported_destination_sync_modes:
- "overwrite"
- "append"
- dockerImage: "airbyte/destination-oracle:0.1.15"
- dockerImage: "airbyte/destination-oracle:0.1.16"
spec:
documentationUrl: "https://docs.airbyte.io/integrations/destinations/oracle"
connectionSpecification:
Expand Down Expand Up @@ -3047,7 +3047,7 @@
supported_destination_sync_modes:
- "overwrite"
- "append"
- dockerImage: "airbyte/destination-postgres:0.3.18"
- dockerImage: "airbyte/destination-postgres:0.3.19"
spec:
documentationUrl: "https://docs.airbyte.io/integrations/destinations/postgres"
connectionSpecification:
Expand Down
33 changes: 17 additions & 16 deletions airbyte-config/init/src/main/resources/seed/source_definitions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
- name: Amazon Ads
sourceDefinitionId: c6b0a29e-1da9-4512-9002-7bfd0cba2246
dockerRepository: airbyte/source-amazon-ads
dockerImageTag: 0.1.5
dockerImageTag: 0.1.7
documentationUrl: https://docs.airbyte.io/integrations/sources/amazon-ads
icon: amazonads.svg
sourceType: api
Expand All @@ -35,14 +35,14 @@
- name: Amplitude
sourceDefinitionId: fa9f58c6-2d03-4237-aaa4-07d75e0c1396
dockerRepository: airbyte/source-amplitude
dockerImageTag: 0.1.4
dockerImageTag: 0.1.5
documentationUrl: https://docs.airbyte.io/integrations/sources/amplitude
icon: amplitude.svg
sourceType: api
- name: Apify Dataset
sourceDefinitionId: 47f17145-fe20-4ef5-a548-e29b048adf84
dockerRepository: airbyte/source-apify-dataset
dockerImageTag: 0.1.9
dockerImageTag: 0.1.11
documentationUrl: https://docs.airbyte.io/integrations/sources/apify-dataset
icon: apify.svg
sourceType: api
Expand Down Expand Up @@ -133,7 +133,7 @@
- name: ClickHouse
sourceDefinitionId: bad83517-5e54-4a3d-9b53-63e85fbd4d7c
dockerRepository: airbyte/source-clickhouse
dockerImageTag: 0.1.8
dockerImageTag: 0.1.10
documentationUrl: https://docs.airbyte.io/integrations/sources/clickhouse
icon: cliskhouse.svg
sourceType: database
Expand All @@ -147,7 +147,7 @@
- name: Cockroachdb
sourceDefinitionId: 9fa5862c-da7c-11eb-8d19-0242ac130003
dockerRepository: airbyte/source-cockroachdb
dockerImageTag: 0.1.10
dockerImageTag: 0.1.11
documentationUrl: https://docs.airbyte.io/integrations/sources/cockroachdb
icon: cockroachdb.svg
sourceType: database
Expand Down Expand Up @@ -272,7 +272,7 @@
- name: Google Ads
sourceDefinitionId: 253487c0-2246-43ba-a21f-5116b20a2c50
dockerRepository: airbyte/source-google-ads
dockerImageTag: 0.1.35
dockerImageTag: 0.1.36
documentationUrl: https://docs.airbyte.io/integrations/sources/google-ads
icon: google-adwords.svg
sourceType: api
Expand Down Expand Up @@ -341,7 +341,7 @@
- name: HubSpot
sourceDefinitionId: 36c891d9-4bd9-43ac-bad2-10e12756272c
dockerRepository: airbyte/source-hubspot
dockerImageTag: 0.1.54
dockerImageTag: 0.1.55
documentationUrl: https://docs.airbyte.io/integrations/sources/hubspot
icon: hubspot.svg
sourceType: api
Expand Down Expand Up @@ -459,7 +459,7 @@
- name: Microsoft SQL Server (MSSQL)
sourceDefinitionId: b5ea17b1-f170-46dc-bc31-cc744ca984c1
dockerRepository: airbyte/source-mssql
dockerImageTag: 0.3.19
dockerImageTag: 0.3.21
documentationUrl: https://docs.airbyte.io/integrations/sources/mssql
icon: mssql.svg
sourceType: database
Expand Down Expand Up @@ -501,7 +501,7 @@
- name: MySQL
sourceDefinitionId: 435bb9a5-7887-4809-aa58-28c27df0d7ad
dockerRepository: airbyte/source-mysql
dockerImageTag: 0.5.6
dockerImageTag: 0.5.9
documentationUrl: https://docs.airbyte.io/integrations/sources/mysql
icon: mysql.svg
sourceType: database
Expand Down Expand Up @@ -529,7 +529,7 @@
- name: OpenWeather
sourceDefinitionId: d8540a80-6120-485d-b7d6-272bca477d9b
dockerRepository: airbyte/source-openweather
dockerImageTag: 0.1.1
dockerImageTag: 0.1.4
documentationUrl: https://docs.airbyte.io/integrations/sources/openweather
sourceType: api
- name: Oracle DB
Expand All @@ -542,7 +542,7 @@
- name: Orb
sourceDefinitionId: 7f0455fb-4518-4ec0-b7a3-d808bf8081cc
dockerRepository: airbyte/source-orb
dockerImageTag: 0.1.1
dockerImageTag: 0.1.2
documentationUrl: https://docs.airbyte.io/integrations/sources/orb
icon: orb.svg
sourceType: api
Expand Down Expand Up @@ -591,7 +591,7 @@
- name: Pipedrive
sourceDefinitionId: d8286229-c680-4063-8c59-23b9b391c700
dockerRepository: airbyte/source-pipedrive
dockerImageTag: 0.1.9
dockerImageTag: 0.1.10
documentationUrl: https://docs.airbyte.io/integrations/sources/pipedrive
icon: pipedrive.svg
sourceType: api
Expand Down Expand Up @@ -625,7 +625,7 @@
- name: Postgres
sourceDefinitionId: decd338e-5647-4c0b-adf4-da0e75f5a750
dockerRepository: airbyte/source-postgres
dockerImageTag: 0.4.10
dockerImageTag: 0.4.11
documentationUrl: https://docs.airbyte.io/integrations/sources/postgres
icon: postgresql.svg
sourceType: database
Expand Down Expand Up @@ -737,7 +737,7 @@
- name: Smartsheets
sourceDefinitionId: 374ebc65-6636-4ea0-925c-7d35999a8ffc
dockerRepository: airbyte/source-smartsheets
dockerImageTag: 0.1.9
dockerImageTag: 0.1.10
documentationUrl: https://docs.airbyte.io/integrations/sources/smartsheets
icon: smartsheet.svg
sourceType: api
Expand All @@ -751,7 +751,7 @@
- name: Snowflake
sourceDefinitionId: e2d65910-8c8b-40a1-ae7d-ee2416b2bfa2
dockerRepository: airbyte/source-snowflake
dockerImageTag: 0.1.10
dockerImageTag: 0.1.11
documentationUrl: https://docs.airbyte.io/integrations/sources/snowflake
icon: snowflake.svg
sourceType: database
Expand Down Expand Up @@ -794,11 +794,12 @@
dockerRepository: airbyte/source-tidb
dockerImageTag: 0.1.0
documentationUrl: https://docs.airbyte.io/integrations/sources/tidb
icon: tidb.svg
sourceType: database
- name: TikTok Marketing
sourceDefinitionId: 4bfac00d-ce15-44ff-95b9-9e3c3e8fbd35
dockerRepository: airbyte/source-tiktok-marketing
dockerImageTag: 0.1.6
dockerImageTag: 0.1.7
documentationUrl: https://docs.airbyte.io/integrations/sources/tiktok-marketing
icon: tiktok.svg
sourceType: api
Expand Down
Loading

6 comments on commit 4168e8f

@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 Mixpanel(#12335)

Measures

Name Value Name Value Name Value
Coverage 75.2 Lines to Cover 306 Vulnerabilities 0
Duplicated Lines (%) 0.0 Lines of Code 384 Reliability Rating A
Code Smells 46 Quality Gate Status OK Bugs 0
Duplicated Blocks 0 Security Rating A Blocker Issues 0
Critical Issues 0 Major Issues 7 Minor Issues 39

Detected Issues

Rule File Description Message
python:mypy_index (MINOR) source_mixpanel/source.py:562 Check indexing operations Unsupported target for indexed assignment ("Mapping[Any, Any]") . Code line: record["cohort_id"] = stream_slice["id"]
python:mypy_index (MINOR) source_mixpanel/source.py:562 Check indexing operations Value of type "Optional[Mapping[str, Any]]" is not indexable . Code line: record["cohort_id"] = stream_slice["id"]
python:mypy_assignment (MINOR) source_mixpanel/source.py:144 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "str") . Code line: data_field: str = None
python:S5890 (MAJOR) source_mixpanel/source.py:144 Values assigned to variables should match their type annotations Assign to "data_field" a value of type "str" instead of "NoneType" or update its type hint.
python:mypy_assignment (MINOR) source_mixpanel/source.py:158 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "str") . Code line: data_field: str = None
python:S5890 (MAJOR) source_mixpanel/source.py:158 Values assigned to variables should match their type annotations Assign to "data_field" a value of type "str" instead of "NoneType" or update its type hint.
python:mypy_no_redef (MINOR) source_mixpanel/source.py:257 Check that each name is defined once Name "stream_state" already defined on line 229 . Code line: stream_state: Dict = stream_state or {}
python:S5890 (MAJOR) source_mixpanel/source.py:365 Values assigned to variables should match their type annotations Assign to "primary_key" a value of type "str" instead of "NoneType" or update its type hint.
python:mypy_assignment (MINOR) source_mixpanel/source.py:365 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "str") . Code line: primary_key: str = None
python:S5890 (MAJOR) source_mixpanel/source.py:648 Values assigned to variables should match their type annotations Assign to "primary_key" a value of type "str" instead of "NoneType" or update its type hint.
python:mypy_assignment (MINOR) source_mixpanel/source.py:648 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "str") . Code line: primary_key: str = None
python:S5890 (MAJOR) source_mixpanel/source.py:649 Values assigned to variables should match their type annotations Assign to "data_field" a value of type "str" instead of "NoneType" or update its type hint.
python:mypy_assignment (MINOR) source_mixpanel/source.py:649 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "str") . Code line: data_field: str = None
python:S5890 (MAJOR) source_mixpanel/source.py:700 Values assigned to variables should match their type annotations Assign to "primary_key" a value of type "str" instead of "NoneType" or update its type hint.
python:mypy_assignment (MINOR) source_mixpanel/source.py:700 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "str") . Code line: primary_key: str = None
python:S5890 (MAJOR) source_mixpanel/source.py:702 Values assigned to variables should match their type annotations Assign to "reqs_per_hour_limit" a value of type "str" instead of "int" or update its type hint.
python:mypy_assignment (MINOR) source_mixpanel/source.py:702 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", base class "MixpanelStream" defined the type as "int") . Code line: reqs_per_hour_limit: str = 60 # 1 query per minute
python:mypy_index (MINOR) source_mixpanel/source.py:840 Check indexing operations Unsupported target for indexed assignment ("Mapping[str, Any]") . Code line: config["start_date"] = start_date or now - timedelta(days=365)
python:mypy_override (MINOR) source_mixpanel/source.py:655 Check that method override is compatible with base class Return type "Iterable[str]" of "process_response" incompatible with return type "Iterable[Mapping[Any, Any]]" in supertype "MixpanelStream" . Code line: def process_response(self, response: requests.Response, **kwargs) ...
python:mypy_valid_type (MINOR) source_mixpanel/source.py:798 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_import (MINOR) source_mixpanel/source.py:15 Require that imported module can be found or has stubs Library stubs not installed for "requests" (or incompatible with Python 3.9) . Code line: import requests
python:mypy_valid_type (MINOR) source_mixpanel/source.py:110 Check that type (annotation) is valid Function "builtins.any" is not valid as a type . Code line: ...ing[str, Any], latest_record: Mapping[str, Any]) -> Mapping[str, any]:
python:mypy_no_redef (MINOR) source_mixpanel/source.py:112 Check that each name is defined once Name "current_stream_state" already defined on line 110 . Code line: current_stream_state: str = current_stream_state.get("date", s...
python:mypy_call_overload (MINOR) source_mixpanel/source.py:114 Check that an overload variant matches arguments No overload variant of "max" matches argument types "MutableMapping[str, Any]", "str" . Code line: return {"date": max(current_stream_state, latest_record_date)}
python:mypy_attr_defined (MINOR) source_mixpanel/source.py:171 Check that attribute exists "DateSlicesMixin" has no attribute "start_date" . Code line: start_date = self.start_date
python:mypy_attr_defined (MINOR) source_mixpanel/source.py:179 Check that attribute exists "DateSlicesMixin" has no attribute "end_date" . Code line: start_date = min(start_date, self.end_date)
python:mypy_attr_defined (MINOR) source_mixpanel/source.py:182 Check that attribute exists "DateSlicesMixin" has no attribute "attribution_window" . Code line: start_date = start_date - timedelta(days=self.attribution_wind...
python:mypy_attr_defined (MINOR) source_mixpanel/source.py:184 Check that attribute exists "DateSlicesMixin" has no attribute "end_date" . Code line: while start_date <= self.end_date:
python:mypy_attr_defined (MINOR) source_mixpanel/source.py:185 Check that attribute exists "DateSlicesMixin" has no attribute "date_window_size" . Code line: ... end_date = start_date + timedelta(days=self.date_window_size...
python:mypy_attr_defined (MINOR) source_mixpanel/source.py:189 Check that attribute exists "DateSlicesMixin" has no attribute "end_date" . Code line: "end_date": str(min(end_date, self.end_date)),
python:mypy_valid_type (MINOR) source_mixpanel/source.py:198 Check that type (annotation) is valid Function "builtins.any" is not valid as a type . Code line: ...e: Mapping[str, Any], stream_slice: Mapping[str, any] = None, next_pag...
python:mypy_index (MINOR) source_mixpanel/source.py:201 Check indexing operations Value of type "Optional[Mapping[str, any?]]" is not indexable . Code line: "from_date": stream_slice["start_date"],
python:mypy_index (MINOR) source_mixpanel/source.py:202 Check indexing operations Value of type "Optional[Mapping[str, any?]]" is not indexable . Code line: "to_date": stream_slice["end_date"],
python:mypy_no_any_return (MINOR) source_mixpanel/source.py:227 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "List[Dict[Any, Any]]" . Code line: return funnel_slices
python:mypy_union_attr (MINOR) source_mixpanel/source.py:265 Check that attribute exists in each item of a union Item "None" of "Optional[Mapping[str, Any]]" has no attribute "get" . Code line: funnel_state = stream_state.get(funnel_id)
python:mypy_arg_type (MINOR) source_mixpanel/source.py:268 Check argument types in calls Argument 1 to "update" of "dict" has incompatible type "Optional[Mapping[str, Any]]"; expected "Mapping[Any, Any]" . Code line: stream_slices.append({**funnel_slice, **date_slice})
python:mypy_valid_type (MINOR) source_mixpanel/source.py:273 Check that type (annotation) is valid Function "builtins.any" is not valid as a type . Code line: ...e: Mapping[str, Any], stream_slice: Mapping[str, any] = None, next_pag...
python:mypy_index (MINOR) source_mixpanel/source.py:278 Check indexing operations Value of type "Optional[Mapping[str, any?]]" is not indexable . Code line: funnel_id = str(stream_slice["funnel_id"])
python:mypy_arg_type (MINOR) source_mixpanel/source.py:281 Check argument types in calls Argument 1 to "request_params" of "DateSlicesMixin" has incompatible type "Optional[Any]"; expected "Mapping[str, Any]" . Code line: params = super().request_params(funnel_state, stream_slice, ne...
python:mypy_index (MINOR) source_mixpanel/source.py:282 Check indexing operations Value of type "Optional[Mapping[str, any?]]" is not indexable . Code line: params["funnel_id"] = stream_slice["funnel_id"]
python:mypy_valid_type (MINOR) source_mixpanel/source.py:428 Check that type (annotation) is valid Function "builtins.any" is not valid as a type . Code line: ...e: Mapping[str, Any], stream_slice: Mapping[str, any] = None, next_pag...
python:mypy_no_any_return (MINOR) source_mixpanel/source.py:534 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 schema
python:mypy_no_any_return (MINOR) source_mixpanel/source.py:788 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 schema
python:mypy_attr_defined (MINOR) source_mixpanel/source.py:839 Check that attribute exists Module has no attribute "parse" . Code line: start_date = pendulum.parse(config["start_date"]).date()
python:mypy_attr_defined (MINOR) source_mixpanel/source.py:844 Check that attribute exists Module has no attribute "parse" . Code line: end_date = pendulum.parse(end_date).date()
python:mypy_index (MINOR) source_mixpanel/source.py:845 Check indexing operations Unsupported target for indexed assignment ("Mapping[str, Any]") . Code line: config["end_date"] = end_date or now # set to now by default

Coverage (75.2%)

File Coverage File Coverage
source_mixpanel/init.py 100.0 source_mixpanel/source.py 75.0

@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 Freshdesk(#12335)

Measures

Name Value Name Value Name Value
Bugs 0 Coverage 66.5 Duplicated Lines (%) 0.0
Security Rating A Quality Gate Status OK Lines of Code 364
Duplicated Blocks 0 Reliability Rating A Vulnerabilities 0
Lines to Cover 284 Code Smells 14 Blocker Issues 0
Critical Issues 0 Major Issues 1 Minor Issues 13

Detected Issues

Rule File Description Message
python:S1134 (MAJOR) source_freshdesk/api.py:13 Track uses of "FIXME" tags Take the required action to fix the issue indicated by this "FIXME" comment.
python:mypy_attr_defined (MINOR) source_freshdesk/api.py:54 Check that attribute exists Module has no attribute "parse" . Code line: self._start_date = pendulum.parse(start_date) if start_date el...
python:mypy_attr_defined (MINOR) source_freshdesk/api.py:307 Check that attribute exists Module has no attribute "parse" . Code line: last_record_updated_at = pendulum.parse(last_record_up...
python:mypy_attr_defined (MINOR) source_freshdesk/api.py:320 Check that attribute exists Module has no attribute "parse" . Code line: cursor = pendulum.parse(record[self.state_pk])
python:mypy_import (MINOR) source_freshdesk/errors.py:6 Require that imported module can be found or has stubs Library stubs not installed for "requests" (or incompatible with Python 3.9) . Code line: from requests import HTTPError
python:mypy_import (MINOR) source_freshdesk/utils.py:10 Require that imported module can be found or has stubs Library stubs not installed for "requests" (or incompatible with Python 3.9) . Code line: import requests
python:mypy_import (MINOR) source_freshdesk/api.py:12 Require that imported module can be found or has stubs Library stubs not installed for "requests" (or incompatible with Python 3.9) . Code line: import requests
python:mypy_attr_defined (MINOR) source_freshdesk/api.py:166 Check that attribute exists Module has no attribute "parse" . Code line: self._state = pendulum.parse(value[self.state_pk])
python:mypy_attr_defined (MINOR) source_freshdesk/api.py:192 Check that attribute exists Module has no attribute "parse" . Code line: cursor = pendulum.parse(record[self.state_pk])
python:mypy_attr_defined (MINOR) source_freshdesk/client.py:11 Check that attribute exists Module "source_freshdesk.api" does not explicitly export attribute "FreshdeskNotFound"; implicit reexport disabled . Code line: from .api import (
python:mypy_attr_defined (MINOR) source_freshdesk/client.py:11 Check that attribute exists Module "source_freshdesk.api" does not explicitly export attribute "FreshdeskError"; implicit reexport disabled . Code line: from .api import (
python:mypy_attr_defined (MINOR) source_freshdesk/client.py:11 Check that attribute exists Module "source_freshdesk.api" does not explicitly export attribute "FreshdeskUnauthorized"; implicit reexport disabled . Code line: from .api import (
python:mypy_valid_type (MINOR) source_freshdesk/client.py:72 Check that type (annotation) is valid Function "builtins.callable" is not valid as a type . Code line: def _enumerate_methods(self) -> Mapping[str, callable]:
python:mypy_return_value (MINOR) source_freshdesk/client.py:88 Check that return value is compatible with signature Incompatible return value type (got "Tuple[bool, Optional[str]]", expected "Tuple[bool, str]") . Code line: return alive, error_msg

Coverage (66.5%)

File Coverage File Coverage
source_freshdesk/init.py 100.0 source_freshdesk/api.py 60.5
source_freshdesk/client.py 52.6 source_freshdesk/errors.py 100.0
source_freshdesk/source.py 100.0 source_freshdesk/utils.py 95.2

@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 Salesforce(#12335)

Measures

Name Value Name Value Name Value
Code Smells 5 Lines to Cover 561 Reliability Rating A
Bugs 0 Duplicated Blocks 0 Vulnerabilities 0
Quality Gate Status OK Security Rating A Lines of Code 867
Coverage 88.1 Duplicated Lines (%) 0.0 Blocker Issues 0
Critical Issues 0 Major Issues 0 Minor Issues 7

Detected Issues

Rule File Description Message
python:black_need_format (MINOR) source_salesforce/streams.py Please run one of the commands: "black --config ./pyproject.toml <path_to_updated_folder>" or "./gradlew format" 1 code part(s) should be updated.
python:mypy_return_value (MINOR) source_salesforce/streams.py:280 Check that return value is compatible with signature Incompatible return value type (got "str", expected "PathLike[Any]") . Code line: return tmp_file
python:mypy_arg_type (MINOR) source_salesforce/streams.py:291 Check argument types in calls Argument 1 to "open" has incompatible type "Optional[str]"; expected "Union[Union[str, bytes, PathLike[str], PathLike[bytes]], int]" . Code line: with open(path, "r", encoding="utf-8") as data:
python:mypy_arg_type (MINOR) source_salesforce/streams.py:301 Check argument types in calls Argument 2 to "TmpFileIOError" has incompatible type "OSError"; expected "Optional[str]" . Code line: ...red while reading tmp data. Called: {path}. Stream: {self.name}", ioe)
python:mypy_arg_type (MINOR) source_salesforce/streams.py:304 Check argument types in calls Argument 1 to "remove" has incompatible type "Optional[str]"; expected "Union[str, bytes, PathLike[str], PathLike[bytes]]" . Code line: os.remove(path)
python:mypy_arg_type (MINOR) source_salesforce/streams.py:365 Check argument types in calls Argument 1 to "read_with_chunks" of "BulkSalesforceStream" has incompatible type "PathLike[Any]"; expected "Optional[str]" . Code line: ... for count, record in self.read_with_chunks(self.download_data(ur...
python:mypy_arg_type (MINOR) source_salesforce/rate_limiting.py Check argument types in calls Argument "jitter" to "on_exception" has incompatible type "None"; expected "Callable[[float], float]" . Code line: jitter=None,

Coverage (88.1%)

File Coverage File Coverage
source_salesforce/init.py 100.0 source_salesforce/api.py 90.7
source_salesforce/exceptions.py 87.5 source_salesforce/rate_limiting.py 86.4
source_salesforce/source.py 92.2 source_salesforce/streams.py 85.4
source_salesforce/utils.py 100.0

@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 Paypal Transaction(#12335)

Measures

Name Value Name Value Name Value
Lines to Cover 296 Bugs 0 Security Rating A
Code Smells 30 Lines of Code 450 Duplicated Blocks 0
Vulnerabilities 0 Quality Gate Status OK Reliability Rating A
Coverage 34.1 Duplicated Lines (%) 0.0 Blocker Issues 0
Critical Issues 0 Major Issues 4 Minor Issues 26

Detected Issues

Rule File Description Message
python:mypy_import (MINOR) bin/fixture_helper.py:9 Require that imported module can be found or has stubs Library stubs not installed for "requests" (or incompatible with Python 3.9) . Code line: import requests
python:mypy_import (MINOR) bin/paypal_transaction_generator.py:20 Require that imported module can be found or has stubs Library stubs not installed for "requests" (or incompatible with Python 3.9) . Code line: import requests
python:S125 (MAJOR) bin/paypal_transaction_generator.py:26 Sections of code should not be commented out Remove this commented out code.
python:S125 (MAJOR) bin/paypal_transaction_generator.py:174 Sections of code should not be commented out Remove this commented out code.
python:mypy_import (MINOR) source_paypal_transaction/source.py:12 Require that imported module can be found or has stubs Library stubs not installed for "requests" (or incompatible with Python 3.9) . Code line: import requests
python:mypy_import (MINOR) source_paypal_transaction/source.py:17 Require that imported module can be found or has stubs Library stubs not installed for "dateutil.parser" (or incompatible with Python 3.9) . Code line: from dateutil.parser import isoparse
python:mypy_assignment (MINOR) source_paypal_transaction/source.py:90 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "Union[datetime, str]", variable has type "datetime") . Code line: self.end_date: datetime = end_date if end_date and end_date < ...
python:mypy_operator (MINOR) source_paypal_transaction/source.py:90 Check that operator is valid for operands Unsupported operand types for < ("str" and "datetime") . Code line: ....end_date: datetime = end_date if end_date and end_date < now else now
python:mypy_operator (MINOR) source_paypal_transaction/source.py:96 Check that operator is valid for operands Unsupported operand types for < ("str" and "datetime") . Code line: if start_date < minimum_allowed_start_date:
python:mypy_union_attr (MINOR) source_paypal_transaction/source.py:99 Check that attribute exists in each item of a union Item "str" of "Union[datetime, str]" has no attribute "isoformat" . Code line: ... f'Stream {self.name}: start_date "{start_date.isoformat(...
python:mypy_operator (MINOR) source_paypal_transaction/source.py:105 Check that operator is valid for operands Unsupported operand types for > ("str" and "datetime") . Code line: if start_date > self.maximum_allowed_start_date:
python:mypy_union_attr (MINOR) source_paypal_transaction/source.py:108 Check that attribute exists in each item of a union Item "str" of "Union[datetime, str]" has no attribute "isoformat" . Code line: ... f'Stream {self.name}: start_date "{start_date.isoformat(...
python:S112 (MAJOR) source_paypal_transaction/source.py:122 "Exception" and "BaseException" should not be raised Replace this generic exception class with a more specific one.
python:mypy_no_any_return (MINOR) source_paypal_transaction/source.py:150 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "None" . Code line: ...te_field(record, self.cursor_field, lambda date: isoparse(date).isofor...
python:mypy_assignment (MINOR) source_paypal_transaction/source.py:175 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "Optional[Any]", variable has type "Mapping[str, Any]") . Code line: data = data.get(attr)
python:mypy_valid_type (MINOR) source_paypal_transaction/source.py:181 Check that type (annotation) is valid Function "builtins.any" is not valid as a type . Code line: ...ing[str, Any], latest_record: Mapping[str, Any]) -> Mapping[str, any]:
python:mypy_union_attr (MINOR) source_paypal_transaction/source.py:196 Check that attribute exists in each item of a union Item "str" of "Union[datetime, str]" has no attribute "isoformat" . Code line: return {"date": self.start_date.isoformat()}
python:mypy_valid_type (MINOR) source_paypal_transaction/source.py:221 Check that type (annotation) is valid Function "builtins.any" is not valid as a type . Code line: ) -> Iterable[Optional[Mapping[str, any]]]:
python:mypy_operator (MINOR) source_paypal_transaction/source.py:244 Check that operator is valid for operands Unsupported operand types for <= ("str" and "datetime") . Code line: while slice_start_date <= self.maximum_allowed_start_date:
python:mypy_union_attr (MINOR) source_paypal_transaction/source.py:247 Check that attribute exists in each item of a union Item "str" of "Union[datetime, str]" has no attribute "isoformat" . Code line: "start_date": slice_start_date.isoformat(),
python:mypy_operator (MINOR) source_paypal_transaction/source.py:248 Check that operator is valid for operands Unsupported operand types for + ("str" and "timedelta") . Code line: ... "end_date": min(slice_start_date + period, self.end_date...
python:mypy_operator (MINOR) source_paypal_transaction/source.py:251 Check that operator is valid for operands Unsupported operand types for + ("str" and "timedelta") . Code line: slice_start_date += period
python:mypy_valid_type (MINOR) source_paypal_transaction/source.py:289 Check that type (annotation) is valid Function "builtins.any" is not valid as a type . Code line: ...e: Mapping[str, Any], stream_slice: Mapping[str, any] = None, next_pag...
python:mypy_assignment (MINOR) source_paypal_transaction/source.py:293 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "Optional[Any]", variable has type "int") . Code line: page_number = next_page_token.get("page")
python:mypy_index (MINOR) source_paypal_transaction/source.py:296 Check indexing operations Value of type "Optional[Mapping[str, any?]]" is not indexable . Code line: "start_date": stream_slice["start_date"],
python:mypy_index (MINOR) source_paypal_transaction/source.py:297 Check indexing operations Value of type "Optional[Mapping[str, any?]]" is not indexable . Code line: "end_date": stream_slice["end_date"],
python:mypy_valid_type (MINOR) source_paypal_transaction/source.py:317 Check that type (annotation) is valid Function "builtins.any" is not valid as a type . Code line: ...e: Mapping[str, Any], stream_slice: Mapping[str, any] = None, next_pag...
python:mypy_index (MINOR) source_paypal_transaction/source.py:320 Check indexing operations Value of type "Optional[Mapping[str, any?]]" is not indexable . Code line: "as_of_time": stream_slice["start_date"],
python:S112 (MAJOR) source_paypal_transaction/source.py:366 "Exception" and "BaseException" should not be raised Replace this generic exception class with a more specific one.
python:mypy_valid_type (MINOR) source_paypal_transaction/source.py:370 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]:

Coverage (34.1%)

File Coverage File Coverage
bin/fixture_helper.py 0.0 bin/paypal_transaction_generator.py 0.0
source_paypal_transaction/init.py 100.0 source_paypal_transaction/source.py 51.3

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

Measures

Name Value Name Value Name Value
Duplicated Blocks 0 Code Smells 45 Bugs 0
Reliability Rating A Lines to Cover 340 Lines of Code 440
Security Rating A Quality Gate Status OK Vulnerabilities 0
Duplicated Lines (%) 0.0 Coverage 76.2 Blocker Issues 0
Critical Issues 0 Major Issues 8 Minor Issues 37

Detected Issues

Rule File Description Message
python:S5890 (MAJOR) source_zendesk_support/streams.py:374 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:374 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_attr_defined (MINOR) source_zendesk_support/streams.py:350 Check that attribute exists Module has no attribute "parse" . Code line: return calendar.timegm(pendulum.parse(state).utctimetuple())
python:mypy_arg_type (MINOR) source_zendesk_support/streams.py:343 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)}
python:S5890 (MAJOR) source_zendesk_support/streams.py:426 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:426 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:427 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:427 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
python:mypy_override (MINOR) source_zendesk_support/streams.py:434 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:352 Check that method override is compatible with base class Signature of "request_params" incompatible with supertype "SourceZendeskSupportFullRefreshStream" . Code line: def request_params(
python:S5890 (MAJOR) source_zendesk_support/streams.py:375 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.
python:mypy_assignment (MINOR) source_zendesk_support/streams.py:375 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:mypy_override (MINOR) source_zendesk_support/streams.py:398 Check that method override is compatible with base class Signature of "request_params" incompatible with supertype "SourceZendeskSupportFullRefreshStream" . Code line: def request_params(
python:mypy_override (MINOR) source_zendesk_support/streams.py:408 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.9) . 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 "deque[Any]") . Code line: future_requests: deque = None
python:mypy_assignment (MINOR) source_zendesk_support/streams.py:185 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:244 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:287 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:S5890 (MAJOR) source_zendesk_support/streams.py:298 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:298 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_return (MINOR) source_zendesk_support/streams.py:339 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:360 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:591 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:599 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:541 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:549 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:491 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.9) . 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.9) . 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.9) . 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:312 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:322 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 (76.2%)

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

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

Measures

Name Value Name Value Name Value
Coverage 91.3 Lines of Code 1137 Duplicated Blocks 0
Vulnerabilities 0 Code Smells 85 Quality Gate Status OK
Bugs 0 Lines to Cover 784 Security Rating A
Duplicated Lines (%) 0.0 Reliability Rating A Blocker Issues 0
Critical Issues 1 Major Issues 8 Minor Issues 76

Detected Issues

Rule File Description Message
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_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.9) . Code line: import requests
python:mypy_assignment (MINOR) source_hubspot/streams.py:946 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", base class "Stream" defined the type as "None") . Code line: primary_key = "id"
python:mypy_assignment (MINOR) source_hubspot/streams.py:990 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", base class "Stream" defined the type as "None") . Code line: primary_key = "canonical-vid"
python:mypy_assignment (MINOR) source_hubspot/streams.py:1020 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", base class "Stream" defined the type as "None") . Code line: primary_key = "id"
python:mypy_assignment (MINOR) source_hubspot/streams.py:1032 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", base class "Stream" defined the type as "None") . Code line: primary_key = "pipelineId"
python:mypy_assignment (MINOR) source_hubspot/streams.py:1044 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", base class "Stream" defined the type as "None") . Code line: primary_key = "id"
python:mypy_assignment (MINOR) source_hubspot/streams.py:1057 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", base class "Stream" defined the type as "None") . Code line: primary_key = "id"
python:mypy_assignment (MINOR) source_hubspot/streams.py:1070 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", base class "Stream" defined the type as "None") . Code line: primary_key = "id"
python:mypy_assignment (MINOR) source_hubspot/streams.py:1152 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", base class "Stream" defined the type as "None") . Code line: primary_key = "id"
python:mypy_assignment (MINOR) source_hubspot/streams.py:1224 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", base class "Stream" defined the type as "None") . Code line: primary_key = "id"
python:mypy_assignment (MINOR) source_hubspot/streams.py:1235 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", base class "Stream" defined the type as "None") . Code line: primary_key = "id"
python:mypy_assignment (MINOR) source_hubspot/streams.py:1302 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", base class "Stream" defined the type as "None") . Code line: primary_key = "id"
python:mypy_assignment (MINOR) source_hubspot/streams.py:1309 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", base class "Stream" defined the type as "None") . Code line: primary_key = "id"
python:mypy_assignment (MINOR) source_hubspot/streams.py:1316 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", base class "Stream" defined the type as "None") . Code line: primary_key = "id"
python:mypy_assignment (MINOR) source_hubspot/streams.py:1323 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", base class "Stream" defined the type as "None") . Code line: primary_key = "id"
python:mypy_assignment (MINOR) source_hubspot/streams.py:1330 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", base class "Stream" defined the type as "None") . Code line: primary_key = "id"
python:mypy_assignment (MINOR) source_hubspot/streams.py:1337 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", base class "Stream" defined the type as "None") . Code line: primary_key = "id"
python:mypy_assignment (MINOR) source_hubspot/streams.py:1344 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", base class "Stream" defined the type as "None") . Code line: primary_key = "id"
python:mypy_assignment (MINOR) source_hubspot/streams.py:1351 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", base class "Stream" defined the type as "None") . Code line: primary_key = "id"
python:mypy_assignment (MINOR) source_hubspot/streams.py:1357 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", base class "Stream" defined the type as "None") . Code line: primary_key = "id"
python:mypy_assignment (MINOR) source_hubspot/streams.py:1362 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", base class "Stream" defined the type as "None") . Code line: primary_key = "id"
python:mypy_assignment (MINOR) source_hubspot/streams.py:1367 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", base class "Stream" defined the type as "None") . Code line: primary_key = "id"
python:mypy_assignment (MINOR) source_hubspot/streams.py:1373 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", base class "Stream" defined the type as "None") . Code line: primary_key = "id"
python:mypy_assignment (MINOR) source_hubspot/streams.py:1378 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", base class "Stream" defined the type as "None") . Code line: primary_key = "id"
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_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_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_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.9) . Code line: from requests import HTTPError
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: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_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_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_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_index (MINOR) source_hubspot/streams.py:237 Check indexing operations Value of type "Optional[Mapping[str, Any]]" is not indexable . Code line: if credentials["credentials_title"] == "API Key Credentials":
python:mypy_union_attr (MINOR) source_hubspot/streams.py:238 Check that attribute exists in each item of a union Item "None" of "Optional[Mapping[str, Any]]" has no attribute "get" . Code line: self._session.params["hapikey"] = credentials.get("api_key...
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_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_arg_type (MINOR) source_hubspot/streams.py:265 Check argument types in calls Argument "stream_state" to "request_headers" of "Stream" has incompatible type "Optional[Mapping[str, Any]]"; expected "Mapping[str, Any]" . Code line: ...uest_headers = self.request_headers(stream_state=stream_state, stream_...
python:mypy_arg_type (MINOR) source_hubspot/streams.py:266 Check argument types in calls Argument "stream_state" to "request_params" of "Stream" has incompatible type "Optional[Mapping[str, Any]]"; expected "Mapping[str, Any]" . Code line: ...equest_params = self.request_params(stream_state=stream_state, stream_...
python:mypy_arg_type (MINOR) source_hubspot/streams.py:315 Check argument types in calls Argument "stream_state" to "parse_response" of "Stream" has incompatible type "Optional[Mapping[str, Any]]"; expected "Mapping[str, Any]" . Code line: ...._transform(self.parse_response(response, stream_state=stream_state)):
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_valid_type (MINOR) source_hubspot/streams.py:433 Check that type (annotation) is valid "None" not callable [misc] casted_value = target_type(field_value)
python:S5806 (MAJOR) source_hubspot/streams.py:451 Builtins should not be shadowed by local variables Rename this variable; it shadows a builtin.
python:mypy_assignment (MINOR) source_hubspot/streams.py:469 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:471 Check that attribute exists Module has no attribute "parse" . Code line: value = pendulum.parse(value)
python:S3776 (CRITICAL) source_hubspot/streams.py:539 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:539 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:548 Check that return value is compatible with signature Return value expected . Code line: return
python:mypy_assignment (MINOR) source_hubspot/streams.py:575 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:579 Miscellaneous other checks Decorated property not supported . Code line: @Property
python:mypy_no_any_return (MINOR) source_hubspot/streams.py:626 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:699 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:701 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: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_arg_type (MINOR) source_hubspot/streams.py:777 Check argument types in calls Argument "stream_state" to "parse_response" of "Stream" has incompatible type "Optional[Mapping[str, Any]]"; expected "Mapping[str, Any]" . Code line: ...m(self.parse_response(raw_response, stream_state=stream_state, stream_...
python:mypy_attr_defined (MINOR) source_hubspot/streams.py:796 Check that attribute exists "_lru_cache_wrapper[Mapping[str, Any]]" has no attribute "keys" . Code line: properties_list = list(self.properties.keys())
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[Any]", variable has type "List[Any]") . Code line: records = self._filter_old_records(records)
python:mypy_assignment (MINOR) source_hubspot/streams.py:816 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_return (MINOR) source_hubspot/streams.py:849 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:875 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_arg_type (MINOR) source_hubspot/streams.py:932 Check argument types in calls Argument 1 to "_flat_associations" of "Stream" has incompatible type "Iterable[Mapping[str, Any]]"; expected "Iterable[MutableMapping[Any, Any]]" . Code line: yield from self._flat_associations(records)
python:mypy_no_redef (MINOR) source_hubspot/streams.py:1072 Check that each name is defined once Name "url" already defined on line 1066 . Code line: @Property
python:mypy_index (MINOR) source_hubspot/streams.py:1172 Check indexing operations Value of type "Optional[Mapping[str, Any]]" is not indexable . Code line: return f"{self.url}/{stream_slice['form_id']}"
python:mypy_index (MINOR) source_hubspot/streams.py:1210 Check indexing operations Unsupported target for indexed assignment ("Mapping[str, Any]") . Code line: record["formId"] = stream_slice["form_id"]
python:mypy_index (MINOR) source_hubspot/streams.py:1210 Check indexing operations Value of type "Optional[Mapping[str, Any]]" is not indexable . Code line: record["formId"] = stream_slice["form_id"]
python:mypy_attr_defined (MINOR) source_hubspot/streams.py:1276 Check that attribute exists pendulum.datetime? has no attribute "to_datetime_string" . Code line: version["timestamp"] = self._field_to_datetime...
python:mypy_import (MINOR) source_hubspot/errors.py:6 Require that imported module can be found or has stubs Library stubs not installed for "requests" (or incompatible with Python 3.9) . Code line: from requests import HTTPError

Coverage (91.3%)

File Coverage File Coverage
source_hubspot/init.py 100.0 source_hubspot/errors.py 100.0
source_hubspot/source.py 82.6 source_hubspot/streams.py 92.1

Please sign in to comment.