Skip to content

Commit

Permalink
Revert providers/__init__.py changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kaxil committed Oct 18, 2024
1 parent 7f84059 commit 78e990c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
23 changes: 23 additions & 0 deletions providers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

# This exists so that pytest doesn't get confused about namespace packages
# and think that `tests/conftest.py` and `providers/tests/conftest.py` are
# both "tests.conftest"
#
# This is a temporary solution until https:/apache/airflow/issues/42632
# is done
2 changes: 1 addition & 1 deletion providers/tests/openlineage/extractors/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ def test_extract_on_failure(task_state, is_airflow_2_10_or_higher, should_call_o

@mock.patch("airflow.providers.openlineage.conf.custom_extractors")
def test_extractors_env_var(custom_extractors):
custom_extractors.return_value = {"tests.openlineage.extractors.test_base.ExampleExtractor"}
custom_extractors.return_value = {"providers.tests.openlineage.extractors.test_base.ExampleExtractor"}
extractor = ExtractorManager().get_extractor_class(ExampleOperator(task_id="example"))
assert extractor is ExampleExtractor

Expand Down
4 changes: 2 additions & 2 deletions scripts/ci/pre_commit/update_common_sql_api_stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
)
COMMON_SQL_ROOT = (PROVIDERS_ROOT / "common" / "sql").resolve(strict=True)
OUT_DIR = AIRFLOW_SOURCES_ROOT_PATH / "out"
OUT_DIR_PROVIDERS = OUT_DIR / "providers"
OUT_DIR_PROVIDERS = OUT_DIR / PROVIDERS_ROOT.relative_to(AIRFLOW_SOURCES_ROOT_PATH)

COMMON_SQL_PACKAGE_PREFIX = "airflow.providers.common.sql."

Expand Down Expand Up @@ -337,7 +337,7 @@ def compare_stub_files(generated_stub_path: Path, force_override: bool) -> tuple
generated_path = OUT_DIR_PROVIDERS / target_path.relative_to(PROVIDERS_ROOT)
if not generated_path.exists():
console.print(
f"[red]The {generated_path} file is missing in generated files:. "
f"[red]The {target_path} file is missing in generated files:. "
f"This is treated as breaking change."
)
total_removals += 1
Expand Down

0 comments on commit 78e990c

Please sign in to comment.