Skip to content

Backport #32083 to 1.13: initialize DB2 CLI driver once per process - #32154

Merged
pmbrull merged 2 commits into
1.13from
backport/32083-db2-clidriver-1.13
Aug 27, 2026
Merged

pmbrull merged 2 commits into
1.13from
backport/32083-db2-clidriver-1.13

Conversation

@IceS2

@IceS2 IceS2 commented Aug 27, 2026 •

Copy link
Copy Markdown
Collaborator

Backport of #32083 to 1.13. Original issue: #32081.

Caches a successfully installed DB2 CLI driver version for the ingestion process, serializes concurrent installation, keeps failed installs retryable, and reinstalls when the requested version changes.

The connection-file conflict was resolved in the 1.13 module-level get_connection shape: per-connection module invalidation and reload were removed there, while successful invalidation moved to the synchronized installer. The source fix behavior is otherwise unchanged.

Validation: pytest -q tests/unit/source/database/db2 completed with 16 passed and 5 skipped.

@IceS2
IceS2 requested a review from a team as a code owner August 27, 2026 08:03
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@github-actions github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Aug 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

The Python checkstyle failed.

Please run make py_format and py_format_check in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Python code formatting.

You can install the pre-commit hooks with make install_test precommit_install.

@gitar-bot

gitar-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Backports the DB2 CLI driver initialization fix to version 1.13, ensuring the driver is initialized once per process with proper caching and thread-safe installation. No issues found.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@IceS2 IceS2 added db2 skip-pr-checks Bypass PR metadata validation check labels Aug 27, 2026
@pmbrull
pmbrull merged commit 9267ce5 into 1.13 Aug 27, 2026
160 of 194 checks passed
@pmbrull
pmbrull deleted the backport/32083-db2-clidriver-1.13 branch August 27, 2026 09:56
pmbrull pushed a commit that referenced this pull request Aug 28, 2026
* fix(ci): restore the python pipeline on 1.13

PRs targeting 1.13 are validated by main's workflow definitions: the
`pull_request_target` event resolves workflows from the default branch,
while `actions/checkout` puts the 1.13 tree on disk. main's
`py-tests-shared.yml` therefore runs against a checkout that is missing
files it depends on, and every python job goes red regardless of the
diff -- #32154, a Java-only backport, failed identically to #32166.

Three gaps are fixable from this branch:

* `.github/scripts/` does not exist on 1.13 at all. `classify_test_outcome.py`
  exits 2 *after* the tests pass (a postgres shard logged `101 passed` and
  `nox > Session integration-tests was successful`, then failed the job), and
  `configure_docker_storage.sh` exits 127, killing shards 2 and 3 before they
  download anything. Both scripts are copied verbatim from main; they are
  stdlib-only Python and plain bash with no new dependencies. The globs they
  read resolve here -- noxfile.py writes junit/test-results-unit.xml and
  junit/test-results-integration.xml.

* `basedpyright~=1.39.0` floats onto 1.39.10 (released 2026-08-13), which
  reports ~428 errors against this branch's baseline. main pinned
  `==1.39.3` in #27834 to stop exactly this; only the pin is taken here,
  since the rest of that commit conflicts across seven files.

* tests/unit/source/pipeline/openlineage/ is not a package, so its
  test_connection.py collides with the one under
  tests/unit/metadata/ingestion/connections/ and pytest intermittently
  reports `import file mismatch`. main disambiguates with __init__.py.
  Only the leaf marker is added -- enough to make the module name unique
  without renaming every module under tests/unit/source/.

The spaCy 3.8 model mismatch and the ruff-only checkstyle install cannot
be fixed from here; both need main's workflows to probe the checkout.

Co-Authored-By: Claude Opus 5 <[email protected]>

* test(integration): make the airflow, alationsink and ometa tests self-sufficient

Backport of the test half of #32145 (2.0, c1e9302). PRs based on 1.13 are
validated by main's py-tests-shared.yml, which brings the stack up with
`-i false` — no openmetadata_ingestion container, so no Airflow on :8080 and
no sample-data DAGs. These three suites still depended on both and failed
deterministically: four alationsink cases on shard-2, three
test_airflow_lineage cases plus test_es_search_from_name on shard-3, across
every Python version.

 - airflow: a conftest that builds and runs Airflow in a testcontainer joined
   to ometa_network, so the suite owns its DAGs and connection. apache-airflow
   3.3.0 matches this branch's setup.py, the same pin 2.0 uses.
 - alationsink: build the service, database, schema and tables under test
   instead of reading sample_data.ecommerce_db.
 - ometa: a test_team_data fixture creating the "Data" team that
   test_es_search_from_name asserts on.

.dockerignore keeps the airflow image's build context to src/, and only
applies to builds whose context is ingestion/ — every other image builds from
the repository root with the top-level ignore file.

The upstream commit's ingestion/src changes are deliberately omitted: its
PLC0415 annotations and dbt/dbtcloud/vertica suppressions target 2.0's ruff
and 2.0's basedpyright baseline, neither of which applies here. Its
test_ometa_user_api reformatting is also dropped — only the fixture is taken,
so the file stays black-conformant on this branch.

Does not address shard-2's datalake failures (a 400 on recursive service
delete when Airflow is absent), shard-3's trino NO_NODES_AVAILABLE errors, or
test_s3_ingestion.

Co-Authored-By: Claude Opus 5 <[email protected]>

* test(integration): fix the trino readiness race and a stale s3 assertion

trino (shard-3, 38 errors): the container readiness probe queried
system.runtime.nodes, which the system connector answers on every active node
before any catalog can be scheduled. The fixture proceeded and the first
ANALYZE failed with NO_NODES_AVAILABLE, erroring every test in the package.
Probe a real catalog instead, and replace the flat sleep(1) between write and
ANALYZE with a read-back that retries while the hive split is still lagging.
Pin the hive-metastore image by digest so :latest cannot drift under a
maintenance branch.

Only the readiness half of main's trino rework is taken. Its move of drop_stats
into a reset_trino_table_statistics fixture, the folding of test_no_statistics
into test_profiler, and the removal of test_empty_table_with_dropped_stats_falls_back
are a coverage redesign rather than a CI fix, so this branch keeps its global
drop_stats call and all three tests unchanged. Nothing in the trino connector
source is touched.

s3 (shard-3, 1 failed): the container payload no longer inlines children, so
`assert 7 == len(bucket.children.root)` raised AttributeError. The next line
already asserts the same count through list_container_children. The
"Invalid STS API version" logged nearby is the non-mandatory GetMetrics step of
the S3 test connection and fails nothing.

Co-Authored-By: Claude Opus 5 <[email protected]>

* fix(tests): profile in setUpClass so test_list_entity_profiles has data (#31882)

pytest orders unittest TestCase methods alphabetically, so
test_list_entity_profiles runs first -- before test_profiler_workflow has
created any profile. The module sets TestLoader.sortTestMethodsUsing = None
to force definition order, but that only affects unittest's own loader:
pytest collects TestCase methods itself and ignores it. Verified against an
unmodified checkout -- collection still yields list_entity_profiles first
with that line in place, so it has never had any effect here.

The test still passed, because it asserts on a global 24h window across
every table rather than on data it owns, and hard-deleted tables used to
leak their profiler rows into that window. #31556 stopped that leak (issue
"0 not greater than 0" on every PR that actually runs the ingestion
integration matrix, blocking the merge queue. PRs that do not touch
ingestion skip the matrix and report green, which is why this looked
branch-specific rather than repo-wide.

Run the profiler in setUpClass, where fixture data belongs, so no test
depends on another's ordering. Drop the ineffective loader hack, and turn
the `if profiles_all.entities:` guard into an assertion -- that guard
swallowed an empty unfiltered listing and hid which of the two calls was
actually empty, which is the signal needed to diagnose this.

* fix(ci): stabilize remaining 1.13 Python checks

* fix(ci): align 1.13 Python tests with CI

---------

Co-authored-by: Claude Opus 5 <[email protected]>
Co-authored-by: IceS2 <[email protected]>
Co-authored-by: Himanshu Khairajani <[email protected]>
Co-authored-by: Pablo Takara <[email protected]>

This branch was previously deployed

1 inactive deployment
test — 0184adac Deployed Aug 27, 2026 by IceS2 via playwright-ci-postgresql (5, 6) #74789
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

db2 Ingestion safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants