diff --git a/.gitignore b/.gitignore index f42d46fa4..4bffc75c2 100644 --- a/.gitignore +++ b/.gitignore @@ -210,4 +210,7 @@ build/ test.env #intellij stuff -.idea \ No newline at end of file +.idea + +# don't commit authentication info to source control +*.env diff --git a/conftest.py b/pysql-connector/conftest.py similarity index 100% rename from conftest.py rename to pysql-connector/conftest.py diff --git a/pysql-connector/pyproject.toml b/pysql-connector/pyproject.toml index 629f2d32e..2412dd550 100644 --- a/pysql-connector/pyproject.toml +++ b/pysql-connector/pyproject.toml @@ -57,10 +57,10 @@ exclude = ['ttypes\.py$', 'TCLIService\.py$'] [tool.black] exclude = '/(\.eggs|\.git|\.hg|\.mypy_cache|\.nox|\.tox|\.venv|\.svn|_build|buck-out|build|dist|thrift_api)/' -#[tool.pytest.ini_options] -#markers = {"reviewed" = "Test case has been reviewed by Databricks"} -#minversion = "6.0" -#log_cli = "false" -#log_cli_level = "INFO" -#testpaths = ["tests", "src/databricks/sqlalchemy/test_local"] -#env_files = ["test.env"] +[tool.pytest.ini_options] +markers = {"reviewed" = "Test case has been reviewed by Databricks"} +minversion = "6.0" +log_cli = "false" +log_cli_level = "INFO" +testpaths = ["tests"] +env_files = ["test.env"] \ No newline at end of file diff --git a/tests/__init__.py b/pysql-connector/tests/__init__.py similarity index 100% rename from tests/__init__.py rename to pysql-connector/tests/__init__.py diff --git a/tests/e2e/__init__.py b/pysql-connector/tests/e2e/__init__.py similarity index 100% rename from tests/e2e/__init__.py rename to pysql-connector/tests/e2e/__init__.py diff --git a/tests/e2e/common/__init__.py b/pysql-connector/tests/e2e/common/__init__.py similarity index 100% rename from tests/e2e/common/__init__.py rename to pysql-connector/tests/e2e/common/__init__.py diff --git a/tests/e2e/common/core_tests.py b/pysql-connector/tests/e2e/common/core_tests.py similarity index 100% rename from tests/e2e/common/core_tests.py rename to pysql-connector/tests/e2e/common/core_tests.py diff --git a/tests/e2e/common/decimal_tests.py b/pysql-connector/tests/e2e/common/decimal_tests.py similarity index 100% rename from tests/e2e/common/decimal_tests.py rename to pysql-connector/tests/e2e/common/decimal_tests.py diff --git a/tests/e2e/common/large_queries_mixin.py b/pysql-connector/tests/e2e/common/large_queries_mixin.py similarity index 100% rename from tests/e2e/common/large_queries_mixin.py rename to pysql-connector/tests/e2e/common/large_queries_mixin.py diff --git a/tests/e2e/common/predicates.py b/pysql-connector/tests/e2e/common/predicates.py similarity index 100% rename from tests/e2e/common/predicates.py rename to pysql-connector/tests/e2e/common/predicates.py diff --git a/tests/e2e/common/retry_test_mixins.py b/pysql-connector/tests/e2e/common/retry_test_mixins.py similarity index 100% rename from tests/e2e/common/retry_test_mixins.py rename to pysql-connector/tests/e2e/common/retry_test_mixins.py diff --git a/tests/e2e/common/staging_ingestion_tests.py b/pysql-connector/tests/e2e/common/staging_ingestion_tests.py similarity index 100% rename from tests/e2e/common/staging_ingestion_tests.py rename to pysql-connector/tests/e2e/common/staging_ingestion_tests.py diff --git a/tests/e2e/common/timestamp_tests.py b/pysql-connector/tests/e2e/common/timestamp_tests.py similarity index 100% rename from tests/e2e/common/timestamp_tests.py rename to pysql-connector/tests/e2e/common/timestamp_tests.py diff --git a/tests/e2e/common/uc_volume_tests.py b/pysql-connector/tests/e2e/common/uc_volume_tests.py similarity index 100% rename from tests/e2e/common/uc_volume_tests.py rename to pysql-connector/tests/e2e/common/uc_volume_tests.py diff --git a/tests/e2e/test_complex_types.py b/pysql-connector/tests/e2e/test_complex_types.py similarity index 100% rename from tests/e2e/test_complex_types.py rename to pysql-connector/tests/e2e/test_complex_types.py diff --git a/tests/e2e/test_driver.py b/pysql-connector/tests/e2e/test_driver.py similarity index 100% rename from tests/e2e/test_driver.py rename to pysql-connector/tests/e2e/test_driver.py diff --git a/tests/e2e/test_parameterized_queries.py b/pysql-connector/tests/e2e/test_parameterized_queries.py similarity index 100% rename from tests/e2e/test_parameterized_queries.py rename to pysql-connector/tests/e2e/test_parameterized_queries.py diff --git a/tests/unit/__init__.py b/pysql-connector/tests/unit/__init__.py similarity index 100% rename from tests/unit/__init__.py rename to pysql-connector/tests/unit/__init__.py diff --git a/tests/unit/test_arrow_queue.py b/pysql-connector/tests/unit/test_arrow_queue.py similarity index 100% rename from tests/unit/test_arrow_queue.py rename to pysql-connector/tests/unit/test_arrow_queue.py diff --git a/tests/unit/test_auth.py b/pysql-connector/tests/unit/test_auth.py similarity index 100% rename from tests/unit/test_auth.py rename to pysql-connector/tests/unit/test_auth.py diff --git a/tests/unit/test_client.py b/pysql-connector/tests/unit/test_client.py similarity index 100% rename from tests/unit/test_client.py rename to pysql-connector/tests/unit/test_client.py diff --git a/tests/unit/test_cloud_fetch_queue.py b/pysql-connector/tests/unit/test_cloud_fetch_queue.py similarity index 100% rename from tests/unit/test_cloud_fetch_queue.py rename to pysql-connector/tests/unit/test_cloud_fetch_queue.py diff --git a/tests/unit/test_download_manager.py b/pysql-connector/tests/unit/test_download_manager.py similarity index 100% rename from tests/unit/test_download_manager.py rename to pysql-connector/tests/unit/test_download_manager.py diff --git a/tests/unit/test_downloader.py b/pysql-connector/tests/unit/test_downloader.py similarity index 100% rename from tests/unit/test_downloader.py rename to pysql-connector/tests/unit/test_downloader.py diff --git a/tests/unit/test_endpoint.py b/pysql-connector/tests/unit/test_endpoint.py similarity index 100% rename from tests/unit/test_endpoint.py rename to pysql-connector/tests/unit/test_endpoint.py diff --git a/tests/unit/test_fetches.py b/pysql-connector/tests/unit/test_fetches.py similarity index 100% rename from tests/unit/test_fetches.py rename to pysql-connector/tests/unit/test_fetches.py diff --git a/tests/unit/test_fetches_bench.py b/pysql-connector/tests/unit/test_fetches_bench.py similarity index 100% rename from tests/unit/test_fetches_bench.py rename to pysql-connector/tests/unit/test_fetches_bench.py diff --git a/tests/unit/test_init_file.py b/pysql-connector/tests/unit/test_init_file.py similarity index 100% rename from tests/unit/test_init_file.py rename to pysql-connector/tests/unit/test_init_file.py diff --git a/tests/unit/test_oauth_persistence.py b/pysql-connector/tests/unit/test_oauth_persistence.py similarity index 100% rename from tests/unit/test_oauth_persistence.py rename to pysql-connector/tests/unit/test_oauth_persistence.py diff --git a/tests/unit/test_param_escaper.py b/pysql-connector/tests/unit/test_param_escaper.py similarity index 100% rename from tests/unit/test_param_escaper.py rename to pysql-connector/tests/unit/test_param_escaper.py diff --git a/tests/unit/test_parameters.py b/pysql-connector/tests/unit/test_parameters.py similarity index 100% rename from tests/unit/test_parameters.py rename to pysql-connector/tests/unit/test_parameters.py diff --git a/tests/unit/test_retry.py b/pysql-connector/tests/unit/test_retry.py similarity index 100% rename from tests/unit/test_retry.py rename to pysql-connector/tests/unit/test_retry.py diff --git a/tests/unit/test_thrift_backend.py b/pysql-connector/tests/unit/test_thrift_backend.py similarity index 100% rename from tests/unit/test_thrift_backend.py rename to pysql-connector/tests/unit/test_thrift_backend.py diff --git a/sqlalchemy-plugin/pyproject.toml b/sqlalchemy-plugin/pyproject.toml index 98ab20a10..2dce98865 100644 --- a/sqlalchemy-plugin/pyproject.toml +++ b/sqlalchemy-plugin/pyproject.toml @@ -35,4 +35,12 @@ ignore_missing_imports = "true" exclude = ['ttypes\.py$', 'TCLIService\.py$'] [tool.black] -exclude = '/(\.eggs|\.git|\.hg|\.mypy_cache|\.nox|\.tox|\.venv|\.svn|_build|buck-out|build|dist|thrift_api)/' \ No newline at end of file +exclude = '/(\.eggs|\.git|\.hg|\.mypy_cache|\.nox|\.tox|\.venv|\.svn|_build|buck-out|build|dist|thrift_api)/' + +[tool.pytest.ini_options] +markers = {"reviewed" = "Test case has been reviewed by Databricks"} +minversion = "6.0" +log_cli = "false" +log_cli_level = "INFO" +testpaths = ["src/sqlalchemy_db/test_local"] +env_files = ["test.env"] \ No newline at end of file diff --git a/sqlalchemy-plugin/src/sqlalchemy_db/README.sqlalchemy.md b/sqlalchemy-plugin/src/sqlalchemy_db/README.sqlalchemy.md index 2bb79ff94..5ed5c910a 100644 --- a/sqlalchemy-plugin/src/sqlalchemy_db/README.sqlalchemy.md +++ b/sqlalchemy-plugin/src/sqlalchemy_db/README.sqlalchemy.md @@ -10,6 +10,10 @@ A SQLAlchemy 1.4 compatible dialect was first released in connector [version 2.4 To install the dialect and its dependencies: +```shell +pip install databricks-sqlalchemy-dialect +``` +or ```shell pip install databricks-sql-connector[sqlalchemy] ``` diff --git a/sqlalchemy-plugin/src/sqlalchemy_db/README.tests.md b/sqlalchemy-plugin/src/sqlalchemy_db/README.tests.md index d005daa3c..97744a5e8 100644 --- a/sqlalchemy-plugin/src/sqlalchemy_db/README.tests.md +++ b/sqlalchemy-plugin/src/sqlalchemy_db/README.tests.md @@ -23,9 +23,9 @@ We maintain `_extra.py` with test cases that depend on SQLAlchemy's reusable dia ``` poetry shell -cd src/databricks/sqlalchemy/test +cd sqlalchemy-plugin/src/sqlalchemy_db/test python -m pytest test_suite.py --dburi \ - "databricks://token:$access_token@$host?http_path=$http_path&catalog=$catalog&schema=$schema" + "databricks://token:$access_token@$host?http_path=$http_path&catalog=$catalog&schema=$schema -c ../setup.cfg" ``` Whatever schema you pass in the `dburi` argument should be empty. Some tests also require the presence of an empty schema named `test_schema`. Note that we plan to implement our own `provision.py` which SQLAlchemy can automatically use to create an empty schema for testing. But for now this is a manual process.