Skip to content

Commit

Permalink
Merge branch 'master' into marcos/test-pr-10419
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosmarxm committed Feb 21, 2022
2 parents 49b7787 + ce5c007 commit db69988
Show file tree
Hide file tree
Showing 160 changed files with 3,631 additions and 2,778 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.35.31-alpha
current_version = 0.35.32-alpha
commit = False
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-[a-z]+)?
Expand Down
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


### SHARED ###
VERSION=0.35.31-alpha
VERSION=0.35.32-alpha

# When using the airbyte-db via default docker image
CONFIG_ROOT=/data
Expand Down
5 changes: 0 additions & 5 deletions .github/actions/ci-java-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ inputs:
runs:
using: "composite"
steps:
- name: Install Java
uses: actions/setup-java@v1
with:
java-version: '17'

- name: "Build"
shell: bash
run: |
Expand Down
51 changes: 10 additions & 41 deletions .github/actions/ci-py-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,57 +27,26 @@ runs:
- name: Build Coverage Reports
id: build-coverage-reports
shell: bash
working-directory: ${{ inputs.module-folder }}
run: |
virtualenv .venv
source .venv/bin/activate
JSON_CONFIG='{"module": "${{ inputs.module-name }}", "folder": "${{ inputs.module-folder }}", "lang": "py"}'
pip install coverage[toml]~=6.2
mkdir -p .venv/source-acceptance-test
mkdir -p reports
SAT_DIR=$(git rev-parse --show-toplevel)/airbyte-integrations/bases/source-acceptance-test
PYPROJECT_CONFIG=$(git rev-parse --show-toplevel)/pyproject.toml
git ls-tree -r HEAD --name-only $SAT_DIR | while read src; do cp -f $src .venv/source-acceptance-test; done
pip install build
python -m build .venv/source-acceptance-test
pip install .venv/source-acceptance-test/dist/source_acceptance_test-*.whl
[ -f requirements.txt ] && pip install --quiet -r requirements.txt
pip install .[tests]
coverage run --rcfile=${PYPROJECT_CONFIG} -m pytest ./unit_tests || true
coverage xml --rcfile=${PYPROJECT_CONFIG} -o reports/coverage.xml || true
GRADLE_JOB=$(source ./tools/lib/lib.sh; full_path_to_gradle_path ${{ inputs.module-folder }} "unitTest")
REPORT_FOLDER="${{ inputs.module-folder }}/coverage/"
./gradlew --no-daemon -Preports_folder=${REPORT_FOLDER} ${GRADLE_JOB}
rm -rf .venv
echo "::set-output name=coverage-paths::reports/coverage.xml"
echo "::set-output name=coverage-paths::coverage/coverage.xml"
- name: Upload coverage to Codecov
if: ${{ always() }}
uses: codecov/codecov-action@v2
with:
file: ${{ steps.build-coverage-reports.outputs.coverage-paths }}
name: "UnitTests of ${{ inputs.module-name }}"

- name: Build Linter Reports
id: build-linter-reports
shell: bash
working-directory: ${{ inputs.module-folder }}
run: |
JSON_CONFIG='{"module": "${{ inputs.module-name }}", "folder": "${{ inputs.module-folder }}", "lang": "py"}'
REPORT_FOLDER=reports
PYPROJECT_CONFIG=$(git rev-parse --show-toplevel)/pyproject.toml
# run mypy
pip install lxml~=4.7 mypy~=0.910 .
mypy . --config-file=${PYPROJECT_CONFIG} | tee reports/mypy.log || true
# run black
pip install black~=21.12b0
XDG_CACHE_HOME=/dev/null black --config ${PYPROJECT_CONFIG} --diff . | tee reports/black.diff
# run isort
pip install isort~=5.10.1
cp ${PYPROJECT_CONFIG} ./pyproject.toml
isort --diff . | tee reports/isort.diff
# run flake8
pip install mccabe~=0.6.1 pyproject-flake8~=0.0.1a2
pflake8 --exit-zero . | grep ^. | tee reports/flake.txt
GRADLE_JOB=$(source ./tools/lib/lib.sh; full_path_to_gradle_path ${{ inputs.module-folder }} "airbytePythonReport")
REPORT_FOLDER="${{ inputs.module-folder }}/reports/"
./gradlew --no-daemon -Preports_folder=${REPORT_FOLDER} ${GRADLE_JOB}
echo "::set-output name=mypy-logs::reports/mypy.log"
echo "::set-output name=black-diff::reports/black.diff"
Expand Down
11 changes: 9 additions & 2 deletions .github/actions/ci-tests-runner/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,18 @@ runs:
with:
python-version: 3.7

- name: Install Java
uses: actions/setup-java@v1
with:
java-version: '17'

- name: Tests of CI
shell: bash
run: |
# all CI python packages have the prefix "ci_"
pip install --quiet tox==3.24.4
tox -r -c ./tools/tox_ci.ini
pip install --quiet -e ./tools/ci_*
tox -r -c ./tools/tox_ci.ini
echo "::echo::off"
- name: Auth with gcloud CLI
Expand Down Expand Up @@ -109,6 +114,7 @@ runs:
[ -f ${{ steps.ci-py-tests.outputs.coverage-paths }} ] && OPTIONS+=("-Dsonar.python.coverage.reportPaths=${{ steps.ci-py-tests.outputs.coverage-paths }}")
[ -f ${{ steps.ci-py-tests.outputs.flake8-logs }} ] && OPTIONS+=("-Dsonar.python.flake8.reportPaths=${{ steps.ci-py-tests.outputs.flake8-logs }}")
fi
cat ${REPORT_FOLDER}/*
if [ ${{ inputs.module-lang }} == 'java' ]; then
[ -d "./src/main/java" ] && OPTIONS+=("-Dsonar.sources=./src/main/java")
[ -d "./src/test/java" ] && OPTIONS+=("-Dsonar.tests=./src/test/java")
Expand All @@ -133,6 +139,7 @@ runs:
MODULE_DIR=$(python -c "print('${{ inputs.module-folder }}'.replace('${ROOT_DIR}', '.'))")
echo "::set-output name=module_dir::${MODULE_DIR}"
- name: SonarQube Scan

uses: sonarsource/sonarqube-scan-action@master
Expand All @@ -148,7 +155,7 @@ runs:
-Dsonar.language=${{ inputs.module-lang }}
-Dsonar.sourceEncoding=UTF-8
-Dsonar.projectBaseDir=${{ steps.create-sq-project.outputs.module_dir }}
-Dsonar.exclusions=reports/**,*.toml
-Dsonar.exclusions=reports/**,*.toml,*_tests/**,setup.py,main.py
-Dsonar.externalIssuesReportPaths=${{ steps.sq-options.outputs.external_reports }}
${{ steps.sq-options.outputs.options }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sonar-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
sonar-token: ${{ secrets.SONAR_TOKEN }}
sonar-gcp-access-key: ${{ secrets.GCP_SONAR_SA_KEY }}
pull-request-id: "${{ github.repository }}/${{ github.event.pull_request.number }}"
remove-sonar-project: ${{ github.event_name == 'pull_request' && github.event.action == 'closed' }}
remove-sonar-project: ${{ github.event.action == 'closed' }}



4 changes: 2 additions & 2 deletions airbyte-bootloader/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ ENV APPLICATION airbyte-bootloader

WORKDIR /app

ADD bin/${APPLICATION}-0.35.31-alpha.tar /app
ADD bin/${APPLICATION}-0.35.32-alpha.tar /app

ENTRYPOINT ["/bin/bash", "-c", "${APPLICATION}-0.35.31-alpha/bin/${APPLICATION}"]
ENTRYPOINT ["/bin/bash", "-c", "${APPLICATION}-0.35.32-alpha/bin/${APPLICATION}"]
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public void load() throws Exception {

final ConfigPersistence configPersistence = DatabaseConfigPersistence.createWithValidation(configDatabase);
final ConfigRepository configRepository =
new ConfigRepository(configPersistence, null, Optional.empty(), Optional.empty());
new ConfigRepository(configPersistence, null, Optional.empty(), Optional.empty(), configDatabase);

createWorkspaceIfNoneExists(configRepository);
LOGGER.info("Default workspace created..");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
import io.airbyte.config.persistence.split_secrets.SecretsHelpers;
import io.airbyte.config.persistence.split_secrets.SecretsHydrator;
import io.airbyte.config.persistence.split_secrets.SplitSecretConfig;
import io.airbyte.db.Database;
import io.airbyte.db.ExceptionWrappingDatabase;
import io.airbyte.protocol.models.AirbyteCatalog;
import io.airbyte.protocol.models.ConnectorSpecification;
import io.airbyte.validation.json.JsonSchemaValidator;
Expand Down Expand Up @@ -61,15 +63,18 @@ public class ConfigRepository {
private final SecretsHydrator secretsHydrator;
private final Optional<SecretPersistence> longLivedSecretPersistence;
private final Optional<SecretPersistence> ephemeralSecretPersistence;
private final ExceptionWrappingDatabase database;

public ConfigRepository(final ConfigPersistence persistence,
final SecretsHydrator secretsHydrator,
final Optional<SecretPersistence> longLivedSecretPersistence,
final Optional<SecretPersistence> ephemeralSecretPersistence) {
final Optional<SecretPersistence> ephemeralSecretPersistence,
final Database database) {
this.persistence = persistence;
this.secretsHydrator = secretsHydrator;
this.longLivedSecretPersistence = longLivedSecretPersistence;
this.ephemeralSecretPersistence = ephemeralSecretPersistence;
this.database = new ExceptionWrappingDatabase(database);
}

public StandardWorkspace getStandardWorkspace(final UUID workspaceId, final boolean includeTombstone)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import io.airbyte.config.State;
import io.airbyte.config.persistence.split_secrets.MemorySecretPersistence;
import io.airbyte.config.persistence.split_secrets.NoOpSecretsHydrator;
import io.airbyte.db.Database;
import io.airbyte.validation.json.JsonValidationException;
import java.io.IOException;
import java.util.ArrayList;
Expand All @@ -47,13 +48,16 @@ class ConfigRepositoryTest {

private ConfigPersistence configPersistence;
private ConfigRepository configRepository;
private Database database;

@BeforeEach
void setup() {
configPersistence = mock(ConfigPersistence.class);
database = mock(Database.class);
final var secretPersistence = new MemorySecretPersistence();
configRepository =
spy(new ConfigRepository(configPersistence, new NoOpSecretsHydrator(), Optional.of(secretPersistence), Optional.of(secretPersistence)));
spy(new ConfigRepository(configPersistence, new NoOpSecretsHydrator(), Optional.of(secretPersistence), Optional.of(secretPersistence),
database));
}

@AfterEach
Expand Down
6 changes: 3 additions & 3 deletions airbyte-container-orchestrator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ RUN echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] htt
RUN apt-get update && apt-get install -y kubectl

ENV APPLICATION airbyte-container-orchestrator
ENV AIRBYTE_ENTRYPOINT "/app/${APPLICATION}-0.35.31-alpha/bin/${APPLICATION}"
ENV AIRBYTE_ENTRYPOINT "/app/${APPLICATION}-0.35.32-alpha/bin/${APPLICATION}"

WORKDIR /app

# Move orchestrator app
ADD bin/${APPLICATION}-0.35.31-alpha.tar /app
ADD bin/${APPLICATION}-0.35.32-alpha.tar /app

# wait for upstream dependencies to become available before starting server
ENTRYPOINT ["/bin/bash", "-c", "/app/${APPLICATION}-0.35.31-alpha/bin/${APPLICATION}"]
ENTRYPOINT ["/bin/bash", "-c", "/app/${APPLICATION}-0.35.32-alpha/bin/${APPLICATION}"]
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public void start() throws Exception {
AirbyteSentry.executeWithTracing("StartConsumer", this::startTracked,
Map.of("consumerImpl", FailureTrackingAirbyteMessageConsumer.class.getSimpleName()));
} catch (final Exception e) {
LOGGER.error("Exception while starting consumer", e);
hasFailed = true;
throw e;
}
Expand All @@ -48,6 +49,7 @@ public void accept(final AirbyteMessage msg) throws Exception {
try {
acceptTracked(msg);
} catch (final Exception e) {
LOGGER.error("Exception while accepting message", e);
hasFailed = true;
throw e;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class DebeziumConverterUtilsTest {
@Test
public void convertDefaultValueTest() {

RelationalColumn relationalColumn = mock(RelationalColumn.class);
final RelationalColumn relationalColumn = mock(RelationalColumn.class);

when(relationalColumn.isOptional()).thenReturn(true);
Object actualColumnDefaultValue = DebeziumConverterUtils.convertDefaultValue(relationalColumn);
Expand All @@ -35,67 +35,67 @@ public void convertDefaultValueTest() {

when(relationalColumn.isOptional()).thenReturn(false);
when(relationalColumn.hasDefaultValue()).thenReturn(true);
String expectedColumnDefaultValue = "default value";
final String expectedColumnDefaultValue = "default value";
when(relationalColumn.defaultValue()).thenReturn(expectedColumnDefaultValue);
actualColumnDefaultValue = DebeziumConverterUtils.convertDefaultValue(relationalColumn);
Assertions.assertEquals(actualColumnDefaultValue, expectedColumnDefaultValue);
}

@Test
public void convertLocalDate() {
LocalDate localDate = LocalDate.of(2021, 1, 1);
final LocalDate localDate = LocalDate.of(2021, 1, 1);

String actual = DebeziumConverterUtils.convertDate(localDate);
final String actual = DebeziumConverterUtils.convertDate(localDate);
Assertions.assertEquals("2021-01-01T00:00:00Z", actual);
}

@Test
public void convertTLocalTime() {
LocalTime localTime = LocalTime.of(8, 1, 1);
String actual = DebeziumConverterUtils.convertDate(localTime);
final LocalTime localTime = LocalTime.of(8, 1, 1);
final String actual = DebeziumConverterUtils.convertDate(localTime);
Assertions.assertEquals("08:01:01", actual);
}

@Test
public void convertLocalDateTime() {
LocalDateTime localDateTime = LocalDateTime.of(2021, 1, 1, 8, 1, 1);
final LocalDateTime localDateTime = LocalDateTime.of(2021, 1, 1, 8, 1, 1);

String actual = DebeziumConverterUtils.convertDate(localDateTime);
final String actual = DebeziumConverterUtils.convertDate(localDateTime);
Assertions.assertEquals("2021-01-01T08:01:01Z", actual);
}

@Test
@Disabled
public void convertDuration() {
Duration duration = Duration.ofHours(100_000);
final Duration duration = Duration.ofHours(100_000);

String actual = DebeziumConverterUtils.convertDate(duration);
final String actual = DebeziumConverterUtils.convertDate(duration);
Assertions.assertEquals("1981-05-29T20:00:00Z", actual);
}

@Test
public void convertTimestamp() {
LocalDateTime localDateTime = LocalDateTime.of(2021, 1, 1, 8, 1, 1);
Timestamp timestamp = Timestamp.valueOf(localDateTime);
final LocalDateTime localDateTime = LocalDateTime.of(2021, 1, 1, 8, 1, 1);
final Timestamp timestamp = Timestamp.valueOf(localDateTime);

String actual = DebeziumConverterUtils.convertDate(timestamp);
Assertions.assertEquals("2021-01-01T08:01:01Z", actual);
final String actual = DebeziumConverterUtils.convertDate(timestamp);
Assertions.assertEquals("2021-01-01T08:01:01.000000Z", actual);
}

@Test
@Disabled
public void convertNumber() {
Number number = 100_000;
final Number number = 100_000;

String actual = DebeziumConverterUtils.convertDate(number);
final String actual = DebeziumConverterUtils.convertDate(number);
Assertions.assertEquals("1970-01-01T03:01:40Z", actual);
}

@Test
public void convertStringDateFormat() {
String stringValue = "2021-01-01T00:00:00Z";
final String stringValue = "2021-01-01T00:00:00Z";

String actual = DebeziumConverterUtils.convertDate(stringValue);
final String actual = DebeziumConverterUtils.convertDate(stringValue);
Assertions.assertEquals("2021-01-01T00:00:00Z", actual);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ void testInsertRawRecordsInSingleQuery() throws SQLException {
.put(JavaBaseConstants.COLUMN_NAME_AB_ID, RECORD1_UUID)
.put(JavaBaseConstants.COLUMN_NAME_DATA, records.get(0).getData())
.put(JavaBaseConstants.COLUMN_NAME_EMITTED_AT, DataTypeUtils
.toISO8601String(records.get(0).getEmittedAt()))
.toISO8601StringWithMicroseconds(Instant.ofEpochMilli(records.get(0).getEmittedAt())))
.build()),
Jsons.jsonNode(ImmutableMap.builder()
.put(JavaBaseConstants.COLUMN_NAME_AB_ID, RECORD2_UUID)
.put(JavaBaseConstants.COLUMN_NAME_DATA, records.get(1).getData())
.put(JavaBaseConstants.COLUMN_NAME_EMITTED_AT, DataTypeUtils
.toISO8601String(records.get(1).getEmittedAt()))
.toISO8601StringWithMicroseconds(Instant.ofEpochMilli(records.get(1).getEmittedAt())))
.build()));

actualRecords.forEach(
Expand Down
Loading

1 comment on commit db69988

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

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

SonarQube Report

SonarQube report for Airbyte Connectors Source Shopify(#10501)

Measures

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

Detected Issues

Rule File Description Message
python:mypy_arg_type (MINOR) source_shopify/source.py:438 Check argument types in calls Argument 1 to "Shop" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: response = list(Shop(config).read_records(sync_mode=None))
python:mypy_union_attr (MINOR) source_shopify/source.py:461 Check that attribute exists in each item of a union Item "None" of "Optional[List[str]]" has no attribute "iter" (not iterable) . Code line: for stream in SCOPES_MAPPING.get(user_scope["handle"])
python:mypy_assignment (MINOR) source_shopify/auth.py:34 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "Optional[Any]", variable has type "str") . Code line: auth_method: str = credentials.get("auth_method")
python:mypy_misc (MINOR) source_shopify/source.py:70 Miscellaneous other checks Incompatible types in "yield" (actual type "Iterable[MutableMapping[Any, Any]]", expected type "Mapping[Any, Any]") . Code line: yield self._transformer.transform(records)
python:S5890 (MAJOR) source_shopify/source.py:161 Values assigned to variables should match their type annotations Assign to "nested_record_field_name" a value of type "str" instead of "NoneType" or update its type hint.
python:mypy_assignment (MINOR) source_shopify/source.py:161 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "str") . Code line: nested_record_field_name: str = None
python:mypy_unreachable (MINOR) source_shopify/source.py:184 Warn about unreachable statements or expressions Statement is unreachable . Code line: if record.get(self.nested_substream):
python:mypy_union_attr (MINOR) source_shopify/source.py:197 Check that attribute exists in each item of a union Item "None" of "Optional[Mapping[str, Any]]" has no attribute "get" . Code line: slice_data = stream_slice.get(self.slice_key)
python:mypy_assignment (MINOR) source_shopify/source.py:291 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", base class "ChildSubstream" defined the type as "None") . Code line: nested_substream = "refunds"
python:mypy_index (MINOR) source_shopify/source.py:436 Check indexing operations Unsupported target for indexed assignment ("Mapping[str, Any]") . Code line: config["authenticator"] = ShopifyAuthenticator(config)
python:mypy_arg_type (MINOR) source_shopify/source.py:474 Check argument types in calls Argument 1 to "OrderRefunds" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: OrderRefunds(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:475 Check argument types in calls Argument 1 to "OrderRisks" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: OrderRisks(config),
python:mypy_no_any_return (MINOR) source_shopify/transform.py:100 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Iterable[MutableMapping[Any, Any]]" . Code line: return self._transform_string(field)
python:mypy_arg_type (MINOR) source_shopify/source.py:485 Check argument types in calls Argument 1 to "Shop" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Shop(config),
python:mypy_attr_defined (MINOR) source_shopify/source.py:114 Check that attribute exists "str" has no attribute "get" . Code line: if record.get(self.cursor_field, "") >= stream_state.g...
python:S5890 (MAJOR) source_shopify/source.py:386 Values assigned to variables should match their type annotations Assign to "parent_stream_class" a value of type "object" or update its type hint.
python:mypy_assignment (MINOR) source_shopify/source.py:392 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: ...def path(self, stream_slice: Mapping[str, Any] = None, **kwargs) -> st...
python:mypy_arg_type (MINOR) source_shopify/source.py:481 Check argument types in calls Argument 1 to "InventoryItems" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: InventoryItems(config),
python:S5890 (MAJOR) source_shopify/source.py:398 Values assigned to variables should match their type annotations Assign to "parent_stream_class" a value of type "object" or update its type hint.
python:mypy_assignment (MINOR) source_shopify/source.py:405 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: ...def path(self, stream_slice: Mapping[str, Any] = None, **kwargs) -> st...
python:S5890 (MAJOR) source_shopify/source.py:414 Values assigned to variables should match their type annotations Assign to "parent_stream_class" a value of type "object" or update its type hint.
python:mypy_assignment (MINOR) source_shopify/source.py:419 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: ...def path(self, stream_slice: Mapping[str, Any] = None, **kwargs) -> st...
python:mypy_arg_type (MINOR) source_shopify/source.py:483 Check argument types in calls Argument 1 to "FulfillmentOrders" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: FulfillmentOrders(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:484 Check argument types in calls Argument 1 to "Fulfillments" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Fulfillments(config),
python:S5890 (MAJOR) source_shopify/source.py:365 Values assigned to variables should match their type annotations Assign to "parent_stream_class" a value of type "object" or update its type hint.
python:mypy_assignment (MINOR) source_shopify/source.py:370 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: ...def path(self, stream_slice: Mapping[str, Any] = None, **kwargs) -> st...
python:mypy_arg_type (MINOR) source_shopify/source.py:480 Check argument types in calls Argument 1 to "Locations" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Locations(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:482 Check argument types in calls Argument 1 to "InventoryLevels" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: InventoryLevels(config),
python:mypy_assignment (MINOR) source_shopify/auth.py:16 Check that assigned value is compatible with target Incompatible default for argument "auth_method" (default has type "None", argument has type "str") . Code line: def init(self, auth_method: str = None):
python:mypy_index (MINOR) source_shopify/source.py:451 Check indexing operations Unsupported target for indexed assignment ("Mapping[str, Any]") . Code line: config["authenticator"] = ShopifyAuthenticator(config)
python:mypy_arg_type (MINOR) source_shopify/source.py:97 Check argument types in calls Argument 1 to "cache_stream_state" has incompatible type "Callable[[IncrementalShopifyStream, Mapping[str, Any], Mapping[str, Any], KwArg(Any)], Any]"; expected "EagerlyCachedStreamState" . Code line: @stream_state_cache.cache_stream_state
python:S5890 (MAJOR) source_shopify/source.py:159 Values assigned to variables should match their type annotations Assign to "slice_key" a value of type "str" instead of "NoneType" or update its type hint.
python:mypy_assignment (MINOR) source_shopify/source.py:159 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "None", variable has type "str") . Code line: slice_key: str = None
python:mypy_assignment (MINOR) source_shopify/source.py:164 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: ...arams(self, next_page_token: Mapping[str, Any] = None, **kwargs) -> Mu...
python:mypy_assignment (MINOR) source_shopify/source.py:170 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: ...m_slices(self, stream_state: Mapping[str, Any] = None, **kwargs) -> It...
python:mypy_operator (MINOR) source_shopify/source.py:177 Check that operator is valid for operands "object" not callable . Code line: parent_stream = self.parent_stream_class(self.config)
python:mypy_assignment (MINOR) source_shopify/source.py:191 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:S5890 (MAJOR) source_shopify/source.py:285 Values assigned to variables should match their type annotations Assign to "parent_stream_class" a value of type "object" or update its type hint.
python:S5890 (MAJOR) source_shopify/source.py:299 Values assigned to variables should match their type annotations Assign to "parent_stream_class" a value of type "object" or update its type hint.
python:S5890 (MAJOR) source_shopify/source.py:314 Values assigned to variables should match their type annotations Assign to "parent_stream_class" a value of type "object" or update its type hint.
python:S5890 (MAJOR) source_shopify/source.py:340 Values assigned to variables should match their type annotations Assign to "parent_stream_class" a value of type "object" or update its type hint.
python:mypy_attr_defined (MINOR) source_shopify/utils.py:135 Check that attribute exists "object" has no attribute "name" . Code line: state_object[stream.name] = {stream.cursor_field: current_...
python:mypy_attr_defined (MINOR) source_shopify/utils.py:135 Check that attribute exists "object" has no attribute "cursor_field" . Code line: state_object[stream.name] = {stream.cursor_field: current_...
python:mypy_misc (MINOR) source_shopify/source.py:76 Miscellaneous other checks Incompatible types in "yield" (actual type "Iterable[MutableMapping[Any, Any]]", expected type "Mapping[Any, Any]") . Code line: yield self._transformer.transform(record)
python:mypy_return_value (MINOR) source_shopify/transform.py:45 Check that return value is compatible with signature Incompatible return value type (got "Optional[List[str]]", expected "List[str]") . Code line: return json_types.get(value_type)
python:mypy_no_any_return (MINOR) source_shopify/transform.py:54 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "str" . Code line: return schema_types
python:mypy_assignment (MINOR) source_shopify/transform.py:87 Check that assigned value is compatible with target Incompatible default for argument "schema" (default has type "None", argument has type "Mapping[str, Any]") . Code line: ...rm(self, field: Any, schema: Mapping[str, Any] = None) -> Iterable[Mut...
python:mypy_arg_type (MINOR) source_shopify/transform.py:95 Check argument types in calls Argument 1 to "_first_non_null_type" of "DataTypeEnforcer" has incompatible type "str"; expected "List[str]" . Code line: schema_type = self._first_non_null_type(schema_types)
python:mypy_no_any_return (MINOR) source_shopify/transform.py:98 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Iterable[MutableMapping[Any, Any]]" . Code line: return self._transform_number(field)
python:mypy_no_any_return (MINOR) source_shopify/transform.py:103 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Iterable[MutableMapping[Any, Any]]" . Code line: return self._transform_object(field, properties)
python:mypy_no_any_return (MINOR) source_shopify/transform.py:106 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Iterable[MutableMapping[Any, Any]]" . Code line: return self._transform_array(field, properties)
python:mypy_no_any_return (MINOR) source_shopify/transform.py:107 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "Iterable[MutableMapping[Any, Any]]" . Code line: return field
python:mypy_arg_type (MINOR) source_shopify/source.py:466 Check argument types in calls Argument 1 to "Customers" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Customers(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:467 Check argument types in calls Argument 1 to "Orders" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Orders(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:468 Check argument types in calls Argument 1 to "DraftOrders" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: DraftOrders(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:469 Check argument types in calls Argument 1 to "Products" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Products(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:470 Check argument types in calls Argument 1 to "AbandonedCheckouts" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: AbandonedCheckouts(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:471 Check argument types in calls Argument 1 to "Metafields" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Metafields(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:472 Check argument types in calls Argument 1 to "CustomCollections" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: CustomCollections(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:473 Check argument types in calls Argument 1 to "Collects" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Collects(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:476 Check argument types in calls Argument 1 to "Transactions" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Transactions(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:477 Check argument types in calls Argument 1 to "Pages" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: Pages(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:478 Check argument types in calls Argument 1 to "PriceRules" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: PriceRules(config),
python:mypy_arg_type (MINOR) source_shopify/source.py:479 Check argument types in calls Argument 1 to "DiscountCodes" has incompatible type "Mapping[str, Any]"; expected "Dict[Any, Any]" . Code line: DiscountCodes(config),
python:mypy_attr_defined (MINOR) source_shopify/utils.py:132 Check that attribute exists "object" has no attribute "name" . Code line: ... tmp_stream_state_value = state_object.get(stream.name, {}).get(...
python:mypy_attr_defined (MINOR) source_shopify/utils.py:132 Check that attribute exists "object" has no attribute "cursor_field" . Code line: ...te_value = state_object.get(stream.name, {}).get(stream.cursor_field, ...
python:mypy_attr_defined (MINOR) source_shopify/utils.py:138 Check that attribute exists "object" has no attribute "name" . Code line: state_object[stream.name] = {
python:mypy_attr_defined (MINOR) source_shopify/utils.py:139 Check that attribute exists "object" has no attribute "cursor_field" . Code line: stream.cursor_field: min(current_stream_state.get(...
python:S5720 (CRITICAL) source_shopify/utils.py:143 "self" should be the first argument to instance methods Rename "func" to "self" or add the missing "self" parameter.
python:mypy_import (MINOR) source_shopify/utils.py:10 Require that imported module can be found or has stubs Library stubs not installed for "requests" (or incompatible with Python 3.7) . Code line: import requests
python:S5720 (CRITICAL) source_shopify/utils.py:87 "self" should be the first argument to instance methods Rename "threshold" to "self" or add the missing "self" parameter.
python:mypy_misc (MINOR) source_shopify/utils.py:87 Miscellaneous other checks Self argument missing for a non-static method (or an invalid type for self) . Code line: def balance_rate_limit(threshold: float = 0.9, rate_limit_header: ...
python:mypy_assignment (MINOR) source_shopify/source.py:50 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: ...arams(self, next_page_token: Mapping[str, Any] = None, **kwargs) -> Mu...
python:mypy_assignment (MINOR) source_shopify/source.py:55 Check that assigned value is compatible with target Incompatible types in assignment (expression has type "str", target has type "int") . Code line: params["order"] = f"{self.order_field} asc"
python:mypy_assignment (MINOR) source_shopify/source.py:98 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: ...t_params(self, stream_state: Mapping[str, Any] = None, next_page_token...
python:mypy_assignment (MINOR) source_shopify/source.py:98 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: ...tr, Any] = None, next_page_token: Mapping[str, Any] = None, **kwargs):
python:mypy_assignment (MINOR) source_shopify/source.py:110 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: ...an_state(self, stream_state: Mapping[str, Any] = None, records_slice: ...
python:mypy_assignment (MINOR) source_shopify/source.py:110 Check that assigned value is compatible with target Incompatible default for argument "records_slice" (default has type "None", argument has type "Mapping[str, Any]") . Code line: ...tr, Any] = None, records_slice: Mapping[str, Any] = None) -> Iterable:
python:mypy_override (MINOR) source_shopify/source.py:133 Check that method override is compatible with base class Signature of "request_params" incompatible with supertype "ShopifyStream" . Code line: def request_params(
python:mypy_assignment (MINOR) source_shopify/source.py:134 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: self, stream_state: Mapping[str, Any] = None, next_page_token:...
python:mypy_assignment (MINOR) source_shopify/source.py:134 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: ...[str, Any] = None, next_page_token: Mapping[str, Any] = None, **kwargs
python:mypy_override (MINOR) source_shopify/source.py:228 Check that method override is compatible with base class Signature of "request_params" incompatible with supertype "ShopifyStream" . Code line: def request_params(
python:mypy_assignment (MINOR) source_shopify/source.py:229 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: self, stream_state: Mapping[str, Any] = None, next_page_token:...
python:mypy_assignment (MINOR) source_shopify/source.py:229 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: ...[str, Any] = None, next_page_token: Mapping[str, Any] = None, **kwargs
python:mypy_override (MINOR) source_shopify/source.py:274 Check that method override is compatible with base class Signature of "request_params" incompatible with supertype "ShopifyStream" . Code line: def request_params(
python:mypy_assignment (MINOR) source_shopify/source.py:275 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: self, stream_state: Mapping[str, Any] = None, next_page_token:...
python:mypy_assignment (MINOR) source_shopify/source.py:275 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: ...[str, Any] = None, next_page_token: Mapping[str, Any] = None, **kwargs
python:mypy_no_any_return (MINOR) source_shopify/source.py:139 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "MutableMapping[str, Any]" . Code line: return params
python:mypy_no_any_return (MINOR) source_shopify/source.py:235 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "MutableMapping[str, Any]" . Code line: return params
python:mypy_assignment (MINOR) source_shopify/source.py:345 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: ...def path(self, stream_slice: Mapping[str, Any] = None, **kwargs) -> st...
python:mypy_assignment (MINOR) source_shopify/source.py:305 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: ...def path(self, stream_slice: Mapping[str, Any] = None, **kwargs) -> st...
python:mypy_import (MINOR) source_shopify/source.py:10 Require that imported module can be found or has stubs Library stubs not installed for "requests" (or incompatible with Python 3.7) . Code line: import requests
python:mypy_no_any_return (MINOR) source_shopify/source.py:281 Reject returning value with "Any" type if return type is not "Any" Returning Any from function declared to return "MutableMapping[str, Any]" . Code line: return params
python:mypy_assignment (MINOR) source_shopify/source.py:293 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: ...def path(self, stream_slice: Mapping[str, Any] = None, **kwargs) -> st...
python:mypy_assignment (MINOR) source_shopify/source.py:320 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: ...def path(self, stream_slice: Mapping[str, Any] = None, **kwargs) -> st...
python:mypy_return (MINOR) source_shopify/source.py:432 Check that function always returns a value Missing return statement . Code line: def check_connection(self, logger: AirbyteLogger, config: Mapping[...
python:mypy_valid_type (MINOR) source_shopify/source.py:432 Check that type (annotation) is valid Function "builtins.any" is not valid as a type . Code line: ...logger: AirbyteLogger, config: Mapping[str, Any]) -> Tuple[bool, any]:

Coverage (71.3%)

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

Please sign in to comment.