sql-testing-library 0.10.0__tar.gz → 0.10.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. {sql_testing_library-0.10.0 → sql_testing_library-0.10.1}/CHANGELOG.md +6 -0
  2. {sql_testing_library-0.10.0 → sql_testing_library-0.10.1}/PKG-INFO +68 -5
  3. {sql_testing_library-0.10.0 → sql_testing_library-0.10.1}/README.md +67 -4
  4. {sql_testing_library-0.10.0 → sql_testing_library-0.10.1}/pyproject.toml +1 -1
  5. {sql_testing_library-0.10.0 → sql_testing_library-0.10.1}/src/sql_testing_library/_exceptions.py +14 -3
  6. {sql_testing_library-0.10.0 → sql_testing_library-0.10.1}/LICENSE +0 -0
  7. {sql_testing_library-0.10.0 → sql_testing_library-0.10.1}/src/sql_testing_library/__init__.py +0 -0
  8. {sql_testing_library-0.10.0 → sql_testing_library-0.10.1}/src/sql_testing_library/_adapters/__init__.py +0 -0
  9. {sql_testing_library-0.10.0 → sql_testing_library-0.10.1}/src/sql_testing_library/_adapters/athena.py +0 -0
  10. {sql_testing_library-0.10.0 → sql_testing_library-0.10.1}/src/sql_testing_library/_adapters/base.py +0 -0
  11. {sql_testing_library-0.10.0 → sql_testing_library-0.10.1}/src/sql_testing_library/_adapters/bigquery.py +0 -0
  12. {sql_testing_library-0.10.0 → sql_testing_library-0.10.1}/src/sql_testing_library/_adapters/presto.py +0 -0
  13. {sql_testing_library-0.10.0 → sql_testing_library-0.10.1}/src/sql_testing_library/_adapters/redshift.py +0 -0
  14. {sql_testing_library-0.10.0 → sql_testing_library-0.10.1}/src/sql_testing_library/_adapters/snowflake.py +0 -0
  15. {sql_testing_library-0.10.0 → sql_testing_library-0.10.1}/src/sql_testing_library/_adapters/trino.py +0 -0
  16. {sql_testing_library-0.10.0 → sql_testing_library-0.10.1}/src/sql_testing_library/_core.py +0 -0
  17. {sql_testing_library-0.10.0 → sql_testing_library-0.10.1}/src/sql_testing_library/_mock_table.py +0 -0
  18. {sql_testing_library-0.10.0 → sql_testing_library-0.10.1}/src/sql_testing_library/_pytest_plugin.py +0 -0
  19. {sql_testing_library-0.10.0 → sql_testing_library-0.10.1}/src/sql_testing_library/_sql_logger.py +0 -0
  20. {sql_testing_library-0.10.0 → sql_testing_library-0.10.1}/src/sql_testing_library/_sql_utils.py +0 -0
  21. {sql_testing_library-0.10.0 → sql_testing_library-0.10.1}/src/sql_testing_library/_types.py +0 -0
  22. {sql_testing_library-0.10.0 → sql_testing_library-0.10.1}/src/sql_testing_library/py.typed +0 -0
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## 0.10.1 (2025-06-15)
9
+
10
+ ### Fix
11
+
12
+ - run unittests against different os/python versions (#100)
13
+
8
14
  ## 0.10.0 (2025-06-15)
9
15
 
10
16
  ### Feat
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: sql-testing-library
3
- Version: 0.10.0
3
+ Version: 0.10.1
4
4
  Summary: A powerful Python framework for unit testing SQL queries across BigQuery, Snowflake, Redshift, Athena, and Trino with mock data
5
5
  License: MIT
6
6
  Keywords: sql,testing,unit-testing,mock-data,database-testing,bigquery,snowflake,redshift,athena,trino,data-engineering,etl-testing,sql-validation,query-testing
@@ -842,20 +842,83 @@ The adapter_type parameter will use the configuration from the corresponding sec
842
842
 
843
843
  ## Development Setup
844
844
 
845
+ ### Quick Start with Make
846
+
847
+ The project includes a Makefile for common development tasks:
848
+
849
+ ```bash
850
+ # Install all dependencies
851
+ make install
852
+
853
+ # Run unit tests
854
+ make test
855
+
856
+ # Run linting and type checking
857
+ make lint
858
+
859
+ # Format code
860
+ make format
861
+
862
+ # Run all checks (lint + format check + tests)
863
+ make check
864
+
865
+ # See all available commands
866
+ make help
867
+ ```
868
+
869
+ ### Available Make Commands
870
+
871
+ | Command | Description |
872
+ |---------|-------------|
873
+ | `make install` | Install all dependencies with poetry |
874
+ | `make test` | Run unit tests with coverage |
875
+ | `make test-unit` | Run unit tests (excludes integration tests) |
876
+ | `make test-integration` | Run integration tests (requires DB credentials) |
877
+ | `make test-all` | Run all tests (unit + integration) |
878
+ | `make test-tox` | Run tests across all Python versions (3.9-3.12) |
879
+ | `make lint` | Run ruff and mypy checks |
880
+ | `make format` | Format code with black and ruff |
881
+ | `make check` | Run all checks (lint + format + tests) |
882
+ | `make clean` | Remove build artifacts and cache files |
883
+ | `make build` | Build distribution packages |
884
+ | `make docs` | Build documentation |
885
+
886
+ ### Testing Across Python Versions
887
+
888
+ The project supports Python 3.9-3.12. You can test across all versions using:
889
+
890
+ ```bash
891
+ # Using tox (automatically tests all Python versions)
892
+ make test-tox
893
+
894
+ # Or directly with tox
895
+ tox
896
+
897
+ # Test specific Python version
898
+ tox -e py39 # Python 3.9
899
+ tox -e py310 # Python 3.10
900
+ tox -e py311 # Python 3.11
901
+ tox -e py312 # Python 3.12
902
+ ```
903
+
845
904
  ### Code Quality
846
905
 
847
906
  The project uses comprehensive tools to ensure code quality:
848
907
 
849
908
  1. **Ruff** for linting and formatting
850
- 2. **Pyright** for static type checking
851
- 3. **Pre-commit hooks** for automated checks
909
+ 2. **Black** for code formatting
910
+ 3. **Mypy** for static type checking
911
+ 4. **Pre-commit hooks** for automated checks
852
912
 
853
913
  To set up the development environment:
854
914
 
855
915
  1. Install development dependencies:
856
916
  ```bash
857
- # Install all dependencies including database adapters and dev tools
858
- poetry install --with bigquery,athena,redshift,trino,snowflake,dev
917
+ # Using make
918
+ make install
919
+
920
+ # Or directly with poetry
921
+ poetry install --all-extras
859
922
  ```
860
923
 
861
924
  2. Set up pre-commit hooks:
@@ -785,20 +785,83 @@ The adapter_type parameter will use the configuration from the corresponding sec
785
785
 
786
786
  ## Development Setup
787
787
 
788
+ ### Quick Start with Make
789
+
790
+ The project includes a Makefile for common development tasks:
791
+
792
+ ```bash
793
+ # Install all dependencies
794
+ make install
795
+
796
+ # Run unit tests
797
+ make test
798
+
799
+ # Run linting and type checking
800
+ make lint
801
+
802
+ # Format code
803
+ make format
804
+
805
+ # Run all checks (lint + format check + tests)
806
+ make check
807
+
808
+ # See all available commands
809
+ make help
810
+ ```
811
+
812
+ ### Available Make Commands
813
+
814
+ | Command | Description |
815
+ |---------|-------------|
816
+ | `make install` | Install all dependencies with poetry |
817
+ | `make test` | Run unit tests with coverage |
818
+ | `make test-unit` | Run unit tests (excludes integration tests) |
819
+ | `make test-integration` | Run integration tests (requires DB credentials) |
820
+ | `make test-all` | Run all tests (unit + integration) |
821
+ | `make test-tox` | Run tests across all Python versions (3.9-3.12) |
822
+ | `make lint` | Run ruff and mypy checks |
823
+ | `make format` | Format code with black and ruff |
824
+ | `make check` | Run all checks (lint + format + tests) |
825
+ | `make clean` | Remove build artifacts and cache files |
826
+ | `make build` | Build distribution packages |
827
+ | `make docs` | Build documentation |
828
+
829
+ ### Testing Across Python Versions
830
+
831
+ The project supports Python 3.9-3.12. You can test across all versions using:
832
+
833
+ ```bash
834
+ # Using tox (automatically tests all Python versions)
835
+ make test-tox
836
+
837
+ # Or directly with tox
838
+ tox
839
+
840
+ # Test specific Python version
841
+ tox -e py39 # Python 3.9
842
+ tox -e py310 # Python 3.10
843
+ tox -e py311 # Python 3.11
844
+ tox -e py312 # Python 3.12
845
+ ```
846
+
788
847
  ### Code Quality
789
848
 
790
849
  The project uses comprehensive tools to ensure code quality:
791
850
 
792
851
  1. **Ruff** for linting and formatting
793
- 2. **Pyright** for static type checking
794
- 3. **Pre-commit hooks** for automated checks
852
+ 2. **Black** for code formatting
853
+ 3. **Mypy** for static type checking
854
+ 4. **Pre-commit hooks** for automated checks
795
855
 
796
856
  To set up the development environment:
797
857
 
798
858
  1. Install development dependencies:
799
859
  ```bash
800
- # Install all dependencies including database adapters and dev tools
801
- poetry install --with bigquery,athena,redshift,trino,snowflake,dev
860
+ # Using make
861
+ make install
862
+
863
+ # Or directly with poetry
864
+ poetry install --all-extras
802
865
  ```
803
866
 
804
867
  2. Set up pre-commit hooks:
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
4
4
 
5
5
  [tool.poetry]
6
6
  name = "sql-testing-library"
7
- version = "0.10.0"
7
+ version = "0.10.1"
8
8
  description = "A powerful Python framework for unit testing SQL queries across BigQuery, Snowflake, Redshift, Athena, and Trino with mock data"
9
9
  authors = ["Gurmeet Saran <gurmeetx@gmail.com>", "Kushal Thakkar <kushal.thakkar@gmail.com>"]
10
10
  maintainers = ["Gurmeet Saran <gurmeetx@gmail.com>", "Kushal Thakkar <kushal.thakkar@gmail.com>"]
@@ -50,6 +50,17 @@ class TypeConversionError(SQLTestingError):
50
50
  self.value = value
51
51
  self.target_type = target_type
52
52
  self.column_name = column_name
53
- super().__init__(
54
- f"Cannot convert '{value}' to {target_type.__name__} for column '{column_name}'"
55
- )
53
+
54
+ # Handle type name extraction for various type forms
55
+ try:
56
+ type_name = target_type.__name__
57
+ except AttributeError:
58
+ # For types like Optional, Union, etc that don't have __name__
59
+ type_name = str(target_type)
60
+
61
+ if column_name:
62
+ message = f"Cannot convert '{value}' to {type_name} for column '{column_name}'"
63
+ else:
64
+ message = f"Cannot convert '{value}' to {type_name}"
65
+
66
+ super().__init__(message)