Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ def __init__(
self._is_match_glob_supported = False
except ImportError:
self._is_match_glob_supported = False
if not self._is_match_glob_supported and match_glob:
raise ValueError("The 'match_glob' parameter requires 'apache-airflow-providers-google>=10.3.0'.")
self.match_glob = match_glob
if not self._is_match_glob_supported and match_glob is not None:
raise ValueError("The 'match_glob' parameter requires 'apache-airflow-providers-google>=10.3.0'.")

def _transform_file_path(self, file_path: str) -> str:
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,17 @@ def test_init_defaults(self):
assert op.create_container is False

@mock.patch("airflow.providers.google.__version__", "10.2.0")
def test_match_glob_requires_recent_google_provider(self):
@mock.patch("airflow.providers.microsoft.azure.transfers.gcs_to_wasb.WasbHook")
@mock.patch("airflow.providers.microsoft.azure.transfers.gcs_to_wasb.GCSHook")
def test_match_glob_requires_recent_google_provider(self, mock_gcs_hook, mock_wasb_hook):
with pytest.raises(ValueError, match="match_glob"):
GCSToAzureBlobStorageOperator(
task_id=TASK_ID,
gcs_bucket=GCS_BUCKET,
container_name=CONTAINER,
match_glob="**/*.csv",
)
mock_gcs_hook.return_value.list.assert_not_called()

@mock.patch("airflow.providers.microsoft.azure.transfers.gcs_to_wasb.WasbHook")
@mock.patch("airflow.providers.microsoft.azure.transfers.gcs_to_wasb.GCSHook")
Expand Down
1 change: 0 additions & 1 deletion scripts/ci/prek/validate_operators_init_exemptions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,4 @@ providers/google/src/airflow/providers/google/cloud/sensors/cloud_composer.py::C
providers/google/src/airflow/providers/google/cloud/transfers/azure_fileshare_to_gcs.py::AzureFileShareToGCSOperator
providers/google/src/airflow/providers/google/cloud/transfers/gcs_to_bigquery.py::GCSToBigQueryOperator
providers/google/src/airflow/providers/google/marketing_platform/operators/campaign_manager.py::GoogleCampaignManagerDeleteReportOperator
providers/microsoft/azure/src/airflow/providers/microsoft/azure/transfers/gcs_to_wasb.py::GCSToAzureBlobStorageOperator
providers/microsoft/psrp/src/airflow/providers/microsoft/psrp/operators/psrp.py::PsrpOperator
Loading