← All tasks
pythondbt-labs/dbt-core #7828Reported task

[CT-2672] [Bug] Cannot import name 'Unpack' from 'typing_extensions' (dbt-core 1.5.1)

envgap__dbt-labs__dbt-core-7828

01 / FAILURE SIGNATURE

Captured in a clean container

- [X] I have searched the existing issues, and I could not find an existing issue for this bug

02 / ENVIRONMENT RECIPE

Base commit
98d1a94b608adcf0c81b5dcda0f5e5362e0620a8
Manifest
core/setup.py
Reproduce
cd /tmp && python3 -c 'from dbt.cli.main import dbtRunner,dbtRunnerResult; result=dbtRunner().invoke(['"'"'--version'"'"']); assert result.success; print('"'"'programmatic invocation succeeded'"'"')'
Run under trace
cd /tmp && python3 -c 'from dbt.cli.main import dbtRunner,dbtRunnerResult; result=dbtRunner().invoke(['"'"'--version'"'"']); assert result.success; print('"'"'programmatic invocation succeeded'"'"')'

03 / ORIGINAL ISSUE TEXT

dbt-labs/dbt-core #7828 · read the original issue
### Is this a new bug in dbt-core?

- [X] I believe this is a new bug in dbt-core
- [X] I have searched the existing issues, and I could not find an existing issue for this bug

### Current Behavior

I’m trying to migrate to dbt-core 1.5.1 and play with programmatic invocations



### Expected Behavior

can import and use dbtRunner, dbtRunnerResult from python environment



### Steps To Reproduce

1. pip install -r requirements.txt (see in the bellow section) 

2. 

```python

from dbt.cli.main import dbtRunner, dbtRunnerResult

# initialize

    dbt_runner = dbtRunner()

    cli_args = ["run", "--select", "tag:my_tag"]



    # run the command

    res: dbtRunnerResult = dbt_runner.invoke(cli_args)



    # inspect the results

    for r in res.result:

        print(f"{r.node.name}: {r.status}")

```

### Relevant log output

```shell
ImportError                               Traceback (most recent call last)

<command-1597366681957068> in <cell line: 1>()

----> 1 from dbt.cli.main import dbtRunner, dbtRunnerResult

      2 

      3 def dbt(args):

      4     # initialize

      5     dbt_runner = dbtRunner()



/databricks/python_shell/dbruntime/PythonPackageImportsInstrumentation/__init__.py in import_patch(name, globals, locals, fromlist, level)

    169             # Import the desired module. If you’re seeing this while debugging a failed import,

    170             # look at preceding stack frames for relevant error information.

--> 171             original_result = python_builtin_import(name, globals, locals, fromlist, level)

    172 

    173             is_root_import = thread_local._nest_level == 1



/local_disk0/.ephemeral_nfs/envs/pythonEnv-8dd839ed-b379-4ba3-b2af-457367cb74b7/lib/python3.9/site-packages/dbt/cli/__init__.py in <module>

----> 1 from .main import cli as dbt_cli  # noqa



/databricks/python_shell/dbruntime/PythonPackageImportsInstrumentation/__init__.py in import_patch(name, globals, locals, fromlist, level)

    169             # Import the desired module. If you’re seeing this while debugging a failed import,

    170             # look at preceding stack frames for relevant error information.

--> 171             original_result = python_builtin_import(name, globals, locals, fromlist, level)

    172 

    173             is_root_import = thread_local._nest_level == 1



/local_disk0/.ephemeral_nfs/envs/pythonEnv-8dd839ed-b379-4ba3-b2af-457367cb74b7/lib/python3.9/site-packages/dbt/cli/main.py in <module>

     11 )

     12 

---> 13 from dbt.cli import requires, params as p

     14 from dbt.cli.exceptions import (

     15     DbtInternalException,



/databricks/python_shell/dbruntime/PythonPackageImportsInstrumentation/__init__.py in import_patch(name, globals, locals, fromlist, level)

    169             # Import the desired module. If you’re seeing this while debugging a failed import,

    170             # look at preceding stack frames for relevant error information.

--> 171             original
Continue on GitHub ↗

04 / LABELS

Labels checked by running the task · assistant reviewed

No supported category has been assigned.

Label rules and the text that matched
[]

Historical install-only results are not EnvGap validation.

The full-history dated commit differs from the old install-only CSV SHA. Dated Git checkout evidence is preserved.

Control workload initializes the actual dbtRunner and invokes the version command without a database; it does not execute warehouse queries.

Runtime version output may query the current public PyPI latest version. Installed dependencies remain governed separately by the oracle date index.

Preparation uses current registries. Historical package availability is not enforced here; execution metadata records this limitation separately from the oracle's date-bounding policy.