Skip to content

Commit

Permalink
bump version ref to 1.6.0
Browse files Browse the repository at this point in the history
Remaining todo per upgrade guide:
- stub materialized views (MV) as a materialization option to show users MV are not supported in sqlite
- stub dbt_clone
- add new available tests from 1.6.0 and re-test to find any remaining issues

No action required:
- Support for Python 3.7 is dropped
- debug_query() does not need to be updated, as its not overwritten in our adapter code
- We use SQLConnectionManager.execute() directly; no changes required
  • Loading branch information
tom-juntunen committed Apr 21, 2024
1 parent bd1c175 commit 76dfc4d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN apt-get update && apt-get -y install git python3 python3-pip python3-venv sq
WORKDIR /opt/dbt-sqlite

RUN python3 -m pip install --upgrade pip \
&& python3 -m pip install pytest pytest-dotenv dbt-core~=1.5.0 dbt-tests-adapter~=1.5.0
&& python3 -m pip install pytest pytest-dotenv dbt-core~=1.6.0 dbt-tests-adapter~=1.6.0

RUN wget -q https://github.com/nalgeon/sqlean/releases/download/0.15.2/crypto.so
RUN wget -q https://github.com/nalgeon/sqlean/releases/download/0.15.2/math.so
Expand Down
2 changes: 1 addition & 1 deletion dbt/adapters/sqlite/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = '1.5.0'
version = '1.6.0'
7 changes: 4 additions & 3 deletions dbt/include/sqlite/macros/utils/dateadd.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{% macro sqlite__dateadd(from_date_or_timestamp, interval, datepart) %}
-- If provided a DATETIME, returns a DATETIME
-- If provided a DATE, returns a DATE

-- Perform date addition based on the detected input format using CASE statements with LIKE for string contains
CASE
-- Check if format is DATETIME
-- Matches DATETIME type based on ISO-8601
WHEN {{ from_date_or_timestamp }} LIKE '%:%' OR ({{ from_date_or_timestamp }} LIKE '%T%' AND {{ from_date_or_timestamp }} LIKE '%Z%') THEN
CASE
WHEN LOWER({{ datepart }}) = 'second' THEN datetime({{ from_date_or_timestamp }}, '+' || {{ interval }} || ' seconds')
Expand All @@ -15,7 +16,7 @@
WHEN LOWER({{ datepart }}) = 'year' THEN datetime({{ from_date_or_timestamp }}, '+' || {{ interval }} || ' years')
ELSE NULL
END
-- Check if format is DATE
-- Matches DATE type based on ISO-8601
WHEN {{ from_date_or_timestamp }} LIKE '%-%' AND {{ from_date_or_timestamp }} NOT LIKE '%T%' AND {{ from_date_or_timestamp }} NOT LIKE '% %' THEN
CASE
WHEN LOWER({{ datepart }}) IN ('second', 'minute', 'hour') THEN date({{ from_date_or_timestamp }})
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def _get_plugin_version():
]
},
install_requires=[
"dbt-core~=1.5.0"
"dbt-core~=1.6.0"
],
classifiers=[
'Development Status :: 4 - Beta',
Expand Down

0 comments on commit 76dfc4d

Please sign in to comment.