class_docstr: Database write tests that share common pytest/parametrize options.
class_docstr_tok: ["Database","write","tests","that","share","common","pytest\/parametrize","options","."]
docstr: Test parsing/handling of quoted database table names.
docstr_tok: ["Test","parsing\/handling","of","quoted","database","table","names","."]
code: def test_write_database_create_quoted_tablename(
      self, engine: DbWriteEngine, tmp_path: Path
  ) -> None:
      """Test parsing/handling of quoted database table names."""
      df = pl.DataFrame(
          {"col x": [100, 200, 300], "col y": ["a", "b", "c"]}
      )
  
      tmp_path.mkdir(exist_ok=True)
      test_db = str(tmp_path / f"test_{engine}.db")
      test_db_uri = f"sqlite:///{test_db}"
  
      # table name requires quoting, and is qualified with the implicit 'main' schema
      qualified_table_name = f'main."test-append-{engine}"'
  
      assert (
          df.write_database(
              table_name=qualified_table_name,
              connection=test_db_uri,
              engine=engine,
          )
          == 3
      )
      assert (
          df.write_database(
              table_name=qualified_table_name,
              connection=test_db_uri,
              if_table_exists="replace",
              engine=engine,
          )
          == 3
      )
      result = pl.read_database(
          query=f"SELECT * FROM {qualified_table_name}",
          connection=create_engine(test_db_uri),
      )
      assert_frame_equal(result, df)
  
file_path: polars/py-polars/tests/unit/io/test_database_write.py
imports: from __future__ import annotations
  import sys
  from typing import TYPE_CHECKING
  import pytest
  from sqlalchemy import create_engine
  import polars
  from polars.testing import assert_frame_equal
label_desc: Use image node_id 3 for calling the TestWriteDatabase obj's underlying member method code with example usage: obj.test_write_database_create_quoted_tablename(engine, tmp_path) without return types