Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

connectors-qa: fix connector type attribute access #35435

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions airbyte-ci/connectors/connectors_qa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ poe lint

## Changelog

### 1.0.2
Fix access to connector types: it should be accessed from the `Connector.connector_type` attribute.

### 1.0.1
* Add `applies_to_connector_types` attribute to `Check` class to specify the connector types that the check applies to.
* Make `CheckPublishToPyPiIsEnabled` run on source connectors only.
Expand Down
2 changes: 1 addition & 1 deletion airbyte-ci/connectors/connectors_qa/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "connectors-qa"
version = "1.0.1"
version = "1.0.2"
description = "A package to run QA checks on Airbyte connectors, generate reports and documentation."
authors = ["Airbyte <contact@airbyte.io>"]
readme = "README.md"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ def run(self, connector: Connector) -> CheckResult:
connector,
f"Check does not apply to {connector.language.value} connectors",
)
if connector.type not in self.applies_to_connector_types:
if connector.connector_type not in self.applies_to_connector_types:
return self.skip(
connector,
f"Check does not apply to {connector.type} connectors",
f"Check does not apply to {connector.connector_type} connectors",
)
return self._run(connector)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ def test_skip_when_language_does_not_apply(self, mocker):

def test_skip_when_type_does_not_apply(self, mocker):
# Arrange
connector = mocker.MagicMock(type="destination")
connector = mocker.MagicMock(connector_type="destination")

# Act
results = []
for check in ENABLED_CHECKS:
if connector.type not in check.applies_to_connector_types:
if connector.connector_type not in check.applies_to_connector_types:
results.append(check.run(connector))

# Assert
Expand Down
Loading