Skip to content

Commit

Permalink
connectors-qa: fix connector type attribute access (#35435)
Browse files Browse the repository at this point in the history
  • Loading branch information
alafanechere committed Feb 20, 2024
1 parent 4889e6e commit 98ed774
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
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

0 comments on commit 98ed774

Please sign in to comment.