Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add doctest to ensure our code samples are valid #1176

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

docs: run blacken docs

205dbc6
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Open

docs: add doctest to ensure our code samples are valid #1176

docs: run blacken docs
205dbc6
Select commit
Loading
Failed to load commit list.
GitHub Actions / Test Results - 3.8 failed Dec 16, 2024 in 0s

1 fail, 6 skipped, 100 pass in 15s

107 tests  ±0   100 ✅ ±0   15s ⏱️ -1s
  1 suites ±0     6 💤 ±0 
  1 files   ±0     1 ❌ ±0 

Results for commit 205dbc6. ± Comparison against earlier commit e271ce0.

Annotations

Check warning on line 0 in duckdb_engine.tests.test_basic

See this annotation in the file changed.

@github-actions github-actions / Test Results - 3.8

test_get_schema_names (duckdb_engine.tests.test_basic) failed

results.xml [took 0s]
Raw output
assert ['"daffy duck..._schema', ...] == ['"daffy duck...ry.main', ...]
  
  At index 0 diff: #x1B[0m#x1B[33m'#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mdaffy duck#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33m.main#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[90m#x1B[39;49;00m != #x1B[0m#x1B[33m'#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mdaffy duck#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33m.information_schema#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
  Right contains 3 more items, first extra item: #x1B[0m#x1B[33m'#x1B[39;49;00m#x1B[33msystem.main#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
  
  Full diff:
  #x1B[0m#x1B[90m #x1B[39;49;00m [#x1B[90m#x1B[39;49;00m
  #x1B[91m-     '"daffy duck".information_schema',#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
  #x1B[90m #x1B[39;49;00m     '"daffy duck".main',#x1B[90m#x1B[39;49;00m
  #x1B[90m #x1B[39;49;00m     '"daffy duck"."quack quack"',#x1B[90m#x1B[39;49;00m
  #x1B[90m #x1B[39;49;00m     '"daffy duck"."you\'re "" despicable"',#x1B[90m#x1B[39;49;00m
  #x1B[91m-     'memory.information_schema',#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
  #x1B[90m #x1B[39;49;00m     'memory.main',#x1B[90m#x1B[39;49;00m
  #x1B[90m #x1B[39;49;00m     'memory."quack quack"',#x1B[90m#x1B[39;49;00m
  #x1B[90m #x1B[39;49;00m     'system.information_schema',#x1B[90m#x1B[39;49;00m
  #x1B[90m #x1B[39;49;00m     'system.main',#x1B[90m#x1B[39;49;00m
  #x1B[91m-     'temp.information_schema',#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
  #x1B[90m #x1B[39;49;00m     'temp.main',#x1B[90m#x1B[39;49;00m
  #x1B[90m #x1B[39;49;00m ]#x1B[90m#x1B[39;49;00m
inspector = <duckdb_engine.DuckDBInspector object at 0x7f123cd3df10>
session = <sqlalchemy.orm.session.Session object at 0x7f123cd3dcd0>

    #x1B[0m#x1B[37m@mark#x1B[39;49;00m.skipif(#x1B[90m#x1B[39;49;00m
        supports_attach #x1B[95mis#x1B[39;49;00m #x1B[94mFalse#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        reason=#x1B[33m"#x1B[39;49;00m#x1B[33mATTACH is not supported for DuckDB version < 0.7.0#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
    )#x1B[90m#x1B[39;49;00m
    #x1B[94mdef#x1B[39;49;00m #x1B[92mtest_get_schema_names#x1B[39;49;00m(inspector: Inspector, session: Session) -> #x1B[94mNone#x1B[39;49;00m:#x1B[90m#x1B[39;49;00m
        #x1B[90m# Using multi-line strings because of all the single and double quotes flying around...#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        cmds = [#x1B[90m#x1B[39;49;00m
    #x1B[90m        #x1B[39;49;00m#x1B[33m"""CREATE SCHEMA "quack quack" """#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
    #x1B[90m        #x1B[39;49;00m#x1B[33m"""CREATE SCHEMA "daffy duck"."you're "" despicable" """#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
        ]#x1B[90m#x1B[39;49;00m
        #x1B[94mfor#x1B[39;49;00m cmd #x1B[95min#x1B[39;49;00m cmds:#x1B[90m#x1B[39;49;00m
            session.execute(text(cmd))#x1B[90m#x1B[39;49;00m
            session.commit()#x1B[90m#x1B[39;49;00m
    #x1B[90m#x1B[39;49;00m
        #x1B[90m# Deliberately excluding pg_catalog schema (to align with Postgres)#x1B[39;49;00m#x1B[90m#x1B[39;49;00m
        names = inspector.get_schema_names()#x1B[90m#x1B[39;49;00m
        #x1B[94mif#x1B[39;49;00m supports_attach:#x1B[90m#x1B[39;49;00m
>           #x1B[94massert#x1B[39;49;00m names == [#x1B[90m#x1B[39;49;00m
                #x1B[33m'#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mdaffy duck#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33m.information_schema#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                #x1B[33m'#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mdaffy duck#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33m.main#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                #x1B[33m'#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mdaffy duck#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33m.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mquack quack#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                #x1B[33m'#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mdaffy duck#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33m.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33myou#x1B[39;49;00m#x1B[33m\'#x1B[39;49;00m#x1B[33mre #x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33m despicable#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                #x1B[33m"#x1B[39;49;00m#x1B[33mmemory.information_schema#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                #x1B[33m"#x1B[39;49;00m#x1B[33mmemory.main#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                #x1B[33m'#x1B[39;49;00m#x1B[33mmemory.#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mquack quack#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                #x1B[33m"#x1B[39;49;00m#x1B[33msystem.information_schema#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                #x1B[33m"#x1B[39;49;00m#x1B[33msystem.main#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                #x1B[33m"#x1B[39;49;00m#x1B[33mtemp.information_schema#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
                #x1B[33m"#x1B[39;49;00m#x1B[33mtemp.main#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m,#x1B[90m#x1B[39;49;00m
            ]#x1B[90m#x1B[39;49;00m
#x1B[1m#x1B[31mE           assert ['"daffy duck..._schema', ...] == ['"daffy duck...ry.main', ...]#x1B[0m
#x1B[1m#x1B[31mE             #x1B[0m
#x1B[1m#x1B[31mE             At index 0 diff: #x1B[0m#x1B[33m'#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mdaffy duck#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33m.main#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[90m#x1B[39;49;00m != #x1B[0m#x1B[33m'#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33mdaffy duck#x1B[39;49;00m#x1B[33m"#x1B[39;49;00m#x1B[33m.information_schema#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[90m#x1B[39;49;00m#x1B[0m
#x1B[1m#x1B[31mE             Right contains 3 more items, first extra item: #x1B[0m#x1B[33m'#x1B[39;49;00m#x1B[33msystem.main#x1B[39;49;00m#x1B[33m'#x1B[39;49;00m#x1B[90m#x1B[39;49;00m#x1B[0m
#x1B[1m#x1B[31mE             #x1B[0m
#x1B[1m#x1B[31mE             Full diff:#x1B[0m
#x1B[1m#x1B[31mE             #x1B[0m#x1B[90m #x1B[39;49;00m [#x1B[90m#x1B[39;49;00m#x1B[0m
#x1B[1m#x1B[31mE             #x1B[91m-     '"daffy duck".information_schema',#x1B[39;49;00m#x1B[90m#x1B[39;49;00m#x1B[0m
#x1B[1m#x1B[31mE             #x1B[90m #x1B[39;49;00m     '"daffy duck".main',#x1B[90m#x1B[39;49;00m#x1B[0m
#x1B[1m#x1B[31mE             #x1B[90m #x1B[39;49;00m     '"daffy duck"."quack quack"',#x1B[90m#x1B[39;49;00m#x1B[0m
#x1B[1m#x1B[31mE             #x1B[90m #x1B[39;49;00m     '"daffy duck"."you\'re "" despicable"',#x1B[90m#x1B[39;49;00m#x1B[0m
#x1B[1m#x1B[31mE             #x1B[91m-     'memory.information_schema',#x1B[39;49;00m#x1B[90m#x1B[39;49;00m#x1B[0m
#x1B[1m#x1B[31mE             #x1B[90m #x1B[39;49;00m     'memory.main',#x1B[90m#x1B[39;49;00m#x1B[0m
#x1B[1m#x1B[31mE             #x1B[90m #x1B[39;49;00m     'memory."quack quack"',#x1B[90m#x1B[39;49;00m#x1B[0m
#x1B[1m#x1B[31mE             #x1B[90m #x1B[39;49;00m     'system.information_schema',#x1B[90m#x1B[39;49;00m#x1B[0m
#x1B[1m#x1B[31mE             #x1B[90m #x1B[39;49;00m     'system.main',#x1B[90m#x1B[39;49;00m#x1B[0m
#x1B[1m#x1B[31mE             #x1B[91m-     'temp.information_schema',#x1B[39;49;00m#x1B[90m#x1B[39;49;00m#x1B[0m
#x1B[1m#x1B[31mE             #x1B[90m #x1B[39;49;00m     'temp.main',#x1B[90m#x1B[39;49;00m#x1B[0m
#x1B[1m#x1B[31mE             #x1B[90m #x1B[39;49;00m ]#x1B[90m#x1B[39;49;00m#x1B[0m

#x1B[1m#x1B[31mduckdb_engine/tests/test_basic.py#x1B[0m:189: AssertionError