Skip to content

[fix](dbt-doris) Fix broken test dependencies preventing adapter development#64929

Open
arpitjain099 wants to merge 3 commits into
apache:masterfrom
arpitjain099:fix/dbt-doris-test-deps
Open

[fix](dbt-doris) Fix broken test dependencies preventing adapter development#64929
arpitjain099 wants to merge 3 commits into
apache:masterfrom
arpitjain099:fix/dbt-doris-test-deps

Conversation

@arpitjain099

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: close #60780

Related PR: N/A

Problem Summary:
The dbt-doris adapter test suite cannot run on a fresh checkout due to two dependency issues that have been broken since early 2025.

1. dbt-tests-adapter moved to a new repo

The dbt-tests-adapter package was relocated from dbt-labs/dbt-core (under tests/adapter) to dbt-labs/dbt-adapters (under dbt-tests-adapter). The old git URL in dev-requirements.txt fails during pip install, blocking any contributor from setting up the adapter dev environment.

Updated the URL to git+https://github.com/dbt-labs/dbt-adapters.git@main#subdirectory=dbt-tests-adapter.

2. pytest-logbook incompatible with logbook 1.8+

pytest-logbook==1.2.0 imports logbook.compat, which was removed in logbook 1.8+. Without a pin, pip installs the latest logbook, and every test run fails with:

AttributeError: module 'logbook' has no attribute 'compat'

Added an explicit logbook<1.8 pin to keep pytest-logbook functional.

3. mysql-connector-python lower bound

Raised the lower bound from >=8.0.0 to >=8.0.33 to include authentication-related fixes in the official connector.

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
      • Ran pip install -r extension/dbt-doris/dev-requirements.txt in a clean virtualenv. All packages resolve and install without errors.
      • Confirmed pytest-logbook loads without the logbook.compat AttributeError.
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
  • Does this need documentation?

    • No.

- Update dbt-tests-adapter source URL: the package moved from
  dbt-labs/dbt-core to dbt-labs/dbt-adapters, so pip install
  of dev-requirements.txt fails on a fresh checkout.

- Pin logbook<1.8: pytest-logbook 1.2.0 imports logbook.compat,
  which was removed in logbook 1.8+, causing an AttributeError
  that prevents any test from running.

- Raise mysql-connector-python lower bound to >=8.0.33 to include
  authentication-related fixes.

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

morningman
morningman previously approved these changes Jul 9, 2026
@morningman

Copy link
Copy Markdown
Contributor

run buildall

@morningman

Copy link
Copy Markdown
Contributor

/review

@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label Jul 9, 2026
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

PR approved by at least one committer and no changes requested.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review result: request changes.

Critical checkpoint conclusions:

  • Goal/test: the PR intends to restore the dbt-doris development requirements install path, but the current file still does not satisfy that goal. A clean requirements dry-run fails at the dbt-core VCS requirement, the new dbt-tests-adapter source raises the dev-test Python floor beyond the adapter metadata/tox matrix, and the MySQL connector range still fails the dependency-review gate.
  • Scope: the patch is small and focused to one development requirements file, but the dependency choices are moving upstream refs/ranges, so the fix is not stable enough as written.
  • Concurrency, lifecycle, FE/BE protocol, persistence, data writes, and observability: not applicable to this dependency-manifest-only PR.
  • Compatibility/config: Python support and dependency metadata compatibility need correction before this can be considered fixed.
  • Tests: I did not run Doris build/regression suites; they are not relevant for this one-file extension dependency change in this runner. I verified with pip dry-run, GitHub contents API, the live dependency-review job log, and advisory metadata.
  • Security model: the connector advisory is treated here as a dependency-review CI blocker for an extension/dev dependency, not as a Doris runtime vulnerability claim under the repository threat model.

User focus: no additional user-provided review focus was supplied.

Subagent conclusions: optimizer-rewrite found no optimizer/rewrite impact and was dismissed with evidence. tests-session-config proposed TSC-1/TSC-2/TSC-3; all three were independently verified and became inline comments M-1/M-2/M-3. After the live PR head refreshed to 0578cf6 with the same patch, convergence round 2 ended with both live subagents replying NO_NEW_VALUABLE_FINDINGS for the same refreshed ledger/comment set.

@@ -17,7 +17,7 @@

# install latest changes in dbt-core
git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-core&subdirectory=core

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still leaves the fresh pip install -r extension/dbt-doris/dev-requirements.txt path broken. The PR fixes the dbt-tests-adapter URL, but pip fails earlier on this line because current dbt-labs/dbt-core main no longer has a core Python project (/core 404s and the dry-run reports that subdirectory=core has no Python project metadata). Since the PR body says the full requirements install now succeeds, please update this VCS requirement too, or pin it to a known-good dbt-core tag/release, and rerun the clean install.

# install latest changes in dbt-core
git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-core&subdirectory=core
git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-tests-adapter&subdirectory=tests/adapter
git+https://github.com/dbt-labs/dbt-adapters.git@main#subdirectory=dbt-tests-adapter

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new unpinned main dependency currently declares requires-python = ">=3.10.0" in dbt-tests-adapter/pyproject.toml, but dbt-doris still advertises python_requires=">=3.9" and tox includes py39. A contributor using the supported Python 3.9 dev environment will not be able to install this updated requirement once pip evaluates that package metadata. Please either pin/select a dbt-tests-adapter version that still supports Python 3.9, or update the adapter metadata and tox matrix to require Python 3.10+ in the same change.

twine
wheel
mysql-connector-python>=8.0.0,<8.3
mysql-connector-python>=8.0.33,<8.3

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This range still blocks the dependency-review gate. GitHub flags Connector/Python <9.1.0 for GHSA-hgjp-83m4-h4fj, and <8.3 means every version allowed here is below the patched floor; the PR's dependency-review job is failing on this line. If the connector floor is also an authentication correctness requirement, note that setup.py still permits mysql-connector-python>=8.0.0 for published installs. Please choose a range that can satisfy the gate or explicitly handle the exception, and align runtime metadata if the floor is meant to be required outside dev.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Codex automated review failed and did not complete.

Error: Codex completed, but no new pull request review was submitted for the current head SHA.
Workflow run: https://github.com/apache/doris/actions/runs/29023274277

Please inspect the workflow logs and rerun the review after the underlying issue is resolved.

The previous git refs no longer resolve: dbt-core removed the /core
subdirectory and dbt-tests-adapter moved to dbt-labs/dbt-adapters, whose
main now requires Python 3.10 while this adapter still targets 3.9.

Pin dbt-core and dbt-tests-adapter to the released 1.10 line, which keeps
Python 3.9 support in line with setup.py. Raise mysql-connector-python to
>=9.1.0 for GHSA-hgjp-83m4-h4fj; 9.1 through 9.4 still support 3.9 and the
adapter only uses the stable mysql.connector connect/cursor API.

Verified: pip resolves the full dev-requirements.txt on Python 3.9.6.
Signed-off-by: Arpit Jain <3242828+arpitjain099@users.noreply.github.com>
@github-actions github-actions Bot removed the approved Indicates a PR has been approved by one committer. label Jul 16, 2026
@arpitjain099

Copy link
Copy Markdown
Contributor Author

Thanks for the catch on all three. I dug into the current upstream layout: dbt-core dropped the /core subdirectory (main is the 2.0 Rust rewrite now) and dbt-tests-adapter moved into dbt-labs/dbt-adapters, whose main requires Python 3.10, so both old git refs were dead. I have pinned dbt-core and dbt-tests-adapter to the released 1.10 line, which still supports 3.9 to match setup.py and tox, and raised mysql-connector-python to >=9.1.0 for GHSA-hgjp-83m4-h4fj (9.1 through 9.4 keep 3.9 support, and the adapter only uses the stable connect/cursor API). I verified the whole dev-requirements.txt resolves cleanly with pip on Python 3.9.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] (dbt-doris): The adapters tests are broken due to the pytest-logbook library mismatch with the logbook library

3 participants