Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update history staging models with correct active records #4

Merged
merged 6 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# dbt_workday v0.1.1

[PR #4](https://github.com/fivetran/dbt_workday/pull/4) contains the following updates:
## Bug Fixes
- Updates the filtering done in the history staging models to pull the correct active statuses. Since some changes are entered but not yet effective, we needed to replace the `_fivetran_active` filter to where current timestamp is between `_fivetran_start` and `_fivetran_end` times for each record.
fivetran-reneeli marked this conversation as resolved.
Show resolved Hide resolved

fivetran-joemarkiewicz marked this conversation as resolved.
Show resolved Hide resolved
## Under the Hood
- Switched from using `dbt.current_timestamp_backcompat()` to `dbt.current_timestamp()` since the former has since been deprecated and was just previously used to ensure Snowflake and Postgres compatibility.

# dbt_workday v0.1.0

## 🎉 Initial Release 🎉
Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
config-version: 2
name: 'workday'
version: '0.1.0'
version: '0.1.1'
require-dbt-version: [">=1.3.0", "<2.0.0"]

models:
Expand Down
2 changes: 1 addition & 1 deletion docs/catalog.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/manifest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/run_results.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'workday_integration_tests'
version: '0.1.0'
version: '0.1.1'
config-version: 2

profile: 'integration_tests'
Expand Down
2 changes: 1 addition & 1 deletion models/intermediate/int_workday__worker_details.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ with worker_data as (

select
*,
{{ dbt.current_timestamp_backcompat() }} as current_date
{{ dbt.current_timestamp() }} as current_date
from {{ ref('stg_workday__worker') }}
),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ with worker_position_data as (

select
*,
{{ dbt.current_timestamp_backcompat() }} as current_date
{{ dbt.current_timestamp() }} as current_date
from {{ ref('stg_workday__worker_position') }}
),

Expand Down
2 changes: 1 addition & 1 deletion models/staging/stg_workday__personal_information.sql
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ final as (
tobacco_use as is_tobacco_use,
type
from fields
where coalesce(_fivetran_active, true)
where {{ dbt.current_timestamp() }} between _fivetran_start and _fivetran_end
)

select *
Expand Down
2 changes: 1 addition & 1 deletion models/staging/stg_workday__worker.sql
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ final as (
vesting_date,
worker_code
from fields
where coalesce(_fivetran_active, true)
where {{ dbt.current_timestamp() }} between _fivetran_start and _fivetran_end
)

select *
Expand Down
2 changes: 1 addition & 1 deletion models/staging/stg_workday__worker_position.sql
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ final as (
working_time_unit,
working_time_value
from fields
where coalesce(_fivetran_active, true)
where {{ dbt.current_timestamp() }} between _fivetran_start and _fivetran_end
)

select *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ final as (
primary_business_site,
used_in_change_organization_assignments as is_used_in_change_organization_assignments
from fields
where coalesce(_fivetran_active, true)
where {{ dbt.current_timestamp() }} between _fivetran_start and _fivetran_end
)

select *
Expand Down
Loading