documentation
This commit is contained in:
parent
8979f4d092
commit
0d6e980832
1 changed files with 47 additions and 0 deletions
47
models/staging/xedotcom/schema.yml
Normal file
47
models/staging/xedotcom/schema.yml
Normal file
|
|
@ -0,0 +1,47 @@
|
||||||
|
models:
|
||||||
|
- name: stg_xedotcom__exchange_rates
|
||||||
|
description: >-
|
||||||
|
Exchange Rates source from xedotcom. The time granularity is daily. Each
|
||||||
|
record holds a currency pair for any given day.
|
||||||
|
|
||||||
|
Reverse rates are explicit. This means that, for any given day and any
|
||||||
|
given currency pair. you will find two records with opposite from/to
|
||||||
|
positions. So, for 2024-01-01, you will find both a EUR->USD record and a
|
||||||
|
USD->EUR record with the opposite rate.
|
||||||
|
columns:
|
||||||
|
- name: id_exchange_rate
|
||||||
|
description: A unique ID for record, derived from concatenating the currencies
|
||||||
|
and date. Currency order is relevant (EURUSD != USDEUR).
|
||||||
|
data_type: text
|
||||||
|
tests:
|
||||||
|
- not_null
|
||||||
|
- unique
|
||||||
|
- name: from_currency
|
||||||
|
description: The source currency, represented as an ISO 4217 code.
|
||||||
|
data_type: character
|
||||||
|
tests:
|
||||||
|
- not_null
|
||||||
|
- name: to_currency
|
||||||
|
description: The target currency, represented as an ISO 4217 code.
|
||||||
|
data_type: character
|
||||||
|
tests:
|
||||||
|
- not_null
|
||||||
|
- name: rate
|
||||||
|
description: >-
|
||||||
|
The exchange rate, represnted as the units of the target currency that
|
||||||
|
one unit of source currency gets you. So, from_currency=USD to
|
||||||
|
to_currency=PLN with rate=4.2 should be read as '1 US Dollar buys me
|
||||||
|
4.2 Polish Zlotys'.
|
||||||
|
|
||||||
|
For same currency pairs (EUR to EUR, USD to USD, etc). The rate will
|
||||||
|
always be one.
|
||||||
|
|
||||||
|
The rate can be smaller than one, but can't be negative.
|
||||||
|
data_type: numeric
|
||||||
|
tests:
|
||||||
|
- not_null
|
||||||
|
- name: rate_date_utc
|
||||||
|
description: The date in which the rate record is relevant.
|
||||||
|
data_type: date
|
||||||
|
- name: dwh_extracted_at_utc
|
||||||
|
data_type: timestamp without time zone
|
||||||
Loading…
Add table
Add a link
Reference in a new issue