Skip to content

Commit 5f14721

Browse files
Merge pull request #68 from fivetran/feature/add_xero__calendar_start_date_var
feature/add_xero___calendar_start_date_var
2 parents f48dc77 + d391d36 commit 5f14721

File tree

8 files changed

+29
-6
lines changed

8 files changed

+29
-6
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# dbt_xero v1.0.1
2+
[PR #68](https://github.com/fivetran/dbt_xero/pull/68) includes the following updates:
3+
4+
## Feature Update
5+
- Added optional `xero__calendar_start_date` variable to allow users to customize the start date for the calendar spine model. The variable defaults to `2019-01-01`, maintaining backward compatibility with existing implementations.
6+
7+
## Under the Hood
8+
- Updated `vertical_general_ledger_tracking` validation test to filter on `tracking_option_name`, which was renamed for `option`.
9+
10+
## Documentation
11+
- Updated README to include instructions for configuring the new `xero__calendar_start_date` variable.
12+
113
# dbt_xero v1.0.0
214

315
[PR #64](https://github.com/fivetran/dbt_xero/pull/64) includes the following updates:

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,15 @@ vars:
6464

6565
### (Optional) Step 4: Additional configurations
6666

67+
#### Change the calendar start date
68+
Our date-based models start at `2019-01-01` by default. To customize the start date, add the following variable to your `dbt_project.yml` file:
69+
70+
```yml
71+
vars:
72+
xero:
73+
xero__calendar_start_date: 'yyyy-mm-dd' # default is 2019-01-01
74+
```
75+
6776
#### Multi-currency Support Limitations
6877
Currently, our dbt models for Xero have limited support for multi-currency accounting, particularly for handling unrealized currency gains and losses and bank revaluations, as they require historical or current exchange rate data that is not available in the Xero connector to fully calculate.
6978

dbt_project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: 'xero'
2-
version: '1.0.0'
2+
version: '1.0.1'
33
config-version: 2
44
require-dbt-version: [">=1.3.0", "<2.0.0"]
55

docs/catalog.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/manifest.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

integration_tests/dbt_project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: 'xero_integration_tests'
2-
version: '1.0.0'
2+
version: '1.0.1'
33
profile: 'integration_tests'
44
config-version: 2
55

integration_tests/tests/integrity/vertical_general_ledger_tracking.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ with staging as (
1515
journal_line_id,
1616
source_relation
1717
from {{ ref('stg_xero__journal_line_has_tracking_category') }}
18-
where option is not null
18+
where tracking_option_name is not null
1919
)
2020

2121
{% if using_tracking_categories %}

models/utilities/xero__calendar_spine.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
{% set start_date = var('xero__calendar_start_date', '2019-01-01') %}
2+
13
with spine as (
24

35
{{
46
dbt_utils.date_spine(
57
datepart="month",
6-
start_date="cast('2019-01-01' as date)",
8+
start_date="cast('" ~ start_date ~ "' as date)",
79
end_date=dbt.dateadd(datepart='month', interval=1, from_date_or_timestamp="current_date")
810
)
911
}}

0 commit comments

Comments
 (0)