generated from dpguthrie/snowflake-dbt-demo-project
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from dpguthrie/feat/add-stock-data
Add stock data
- Loading branch information
Showing
6 changed files
with
386 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,265 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: stg_stocks__fund_ownership | ||
description: "" | ||
access: public | ||
columns: | ||
- name: symbol | ||
data_type: varchar | ||
description: "" | ||
|
||
- name: report_date | ||
data_type: date | ||
description: "" | ||
|
||
- name: organization | ||
data_type: varchar | ||
description: "" | ||
|
||
- name: percent_held | ||
data_type: float | ||
description: "" | ||
|
||
- name: total_shares | ||
data_type: float | ||
description: "" | ||
|
||
- name: total_value | ||
data_type: float | ||
description: "" | ||
|
||
- name: percent_change | ||
data_type: float | ||
description: "" | ||
|
||
- name: stg_stocks__grade_history | ||
description: "" | ||
access: public | ||
columns: | ||
- name: symbol | ||
data_type: varchar | ||
description: "" | ||
|
||
- name: epoch_grade_date | ||
data_type: timestamp_ntz | ||
description: "" | ||
|
||
- name: firm | ||
data_type: varchar | ||
description: "" | ||
|
||
- name: to_grade | ||
data_type: varchar | ||
description: "" | ||
|
||
- name: from_grade | ||
data_type: varchar | ||
description: "" | ||
|
||
- name: proposed_action | ||
data_type: varchar | ||
description: "" | ||
|
||
- name: stg_stocks__history | ||
description: "" | ||
access: public | ||
columns: | ||
- name: symbol | ||
data_type: varchar | ||
description: "" | ||
|
||
- name: date | ||
data_type: date | ||
description: "" | ||
|
||
- name: close | ||
data_type: float | ||
description: "" | ||
|
||
- name: volume | ||
data_type: float | ||
description: "" | ||
|
||
- name: open | ||
data_type: float | ||
description: "" | ||
|
||
- name: high | ||
data_type: float | ||
description: "" | ||
|
||
- name: low | ||
data_type: float | ||
description: "" | ||
|
||
- name: adjusted_closed | ||
data_type: float | ||
description: "" | ||
|
||
- name: dividends | ||
data_type: float | ||
description: "" | ||
|
||
- name: splits | ||
data_type: float | ||
description: "" | ||
|
||
- name: stg_stocks__insider_transactions | ||
description: "" | ||
access: public | ||
columns: | ||
- name: symbol | ||
data_type: varchar | ||
description: "" | ||
|
||
- name: shares | ||
data_type: float | ||
description: "" | ||
|
||
- name: filer_url | ||
data_type: varchar | ||
description: "" | ||
|
||
- name: transaction_text | ||
data_type: varchar | ||
description: "" | ||
|
||
- name: filer_name | ||
data_type: varchar | ||
description: "" | ||
|
||
- name: filer_relation | ||
data_type: varchar | ||
description: "" | ||
|
||
- name: money_text | ||
data_type: varchar | ||
description: "" | ||
|
||
- name: start_date | ||
data_type: date | ||
description: "" | ||
|
||
- name: ownership | ||
data_type: varchar | ||
description: "" | ||
|
||
- name: total_value | ||
data_type: float | ||
description: "" | ||
|
||
- name: stg_stocks__recommendation_trends | ||
description: "" | ||
access: public | ||
columns: | ||
- name: symbol | ||
data_type: varchar | ||
description: "" | ||
|
||
- name: period | ||
data_type: varchar | ||
description: "" | ||
|
||
- name: strong_buy | ||
data_type: number | ||
description: "" | ||
|
||
- name: buy | ||
data_type: number | ||
description: "" | ||
|
||
- name: hold | ||
data_type: number | ||
description: "" | ||
|
||
- name: sell | ||
data_type: number | ||
description: "" | ||
|
||
- name: strong_sell | ||
data_type: number | ||
description: "" | ||
|
||
- name: stg_stocks__sec_filings | ||
description: "" | ||
columns: | ||
- name: symbol | ||
data_type: varchar | ||
description: "" | ||
|
||
- name: report_date | ||
data_type: date | ||
description: "" | ||
|
||
- name: epoch_date | ||
data_type: timestamp_ntz | ||
description: "" | ||
|
||
- name: type | ||
data_type: varchar | ||
description: "" | ||
|
||
- name: title | ||
data_type: varchar | ||
description: "" | ||
|
||
- name: edgar_url | ||
data_type: varchar | ||
description: "" | ||
|
||
- name: stg_stocks__summary_profile | ||
description: "" | ||
access: public | ||
columns: | ||
- name: address_1 | ||
data_type: varchar | ||
description: "" | ||
|
||
- name: city | ||
data_type: varchar | ||
description: "" | ||
|
||
- name: state | ||
data_type: varchar | ||
description: "" | ||
|
||
- name: zip_code | ||
data_type: varchar | ||
description: "" | ||
|
||
- name: country | ||
data_type: varchar | ||
description: "" | ||
|
||
- name: phone | ||
data_type: varchar | ||
description: "" | ||
|
||
- name: website | ||
data_type: varchar | ||
description: "" | ||
|
||
- name: industry | ||
data_type: varchar | ||
description: "" | ||
|
||
- name: sector | ||
data_type: varchar | ||
description: "" | ||
|
||
- name: long_business_summary | ||
data_type: varchar | ||
description: "" | ||
|
||
- name: full_time_employees | ||
data_type: number | ||
description: "" | ||
|
||
- name: symbol | ||
data_type: varchar | ||
description: "" | ||
|
||
- name: address_2 | ||
data_type: varchar | ||
description: "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
with | ||
|
||
source as ( | ||
|
||
select * from {{ source('stocks', 'fund_ownership') }} | ||
|
||
), | ||
|
||
renamed as ( | ||
|
||
select | ||
symbol, | ||
report_date, | ||
organization, | ||
pct_held as percent_held, | ||
position as total_shares, | ||
value as total_value, | ||
pct_change as percent_change | ||
|
||
from source | ||
|
||
) | ||
|
||
select * from renamed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
with | ||
|
||
source as ( | ||
|
||
select * from {{ source('stocks', 'grade_history') }} | ||
|
||
), | ||
|
||
renamed as ( | ||
|
||
select | ||
symbol, | ||
epoch_grade_date, | ||
firm, | ||
to_grade, | ||
from_grade, | ||
action as proposed_action | ||
|
||
from source | ||
|
||
) | ||
|
||
select * from renamed |
27 changes: 27 additions & 0 deletions
27
models/staging/stocks/stg_stocks__insider_transactions.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
with | ||
|
||
source as ( | ||
|
||
select * from {{ source('stocks', 'insider_transactions') }} | ||
|
||
), | ||
|
||
renamed as ( | ||
|
||
select | ||
symbol, | ||
shares, | ||
filer_url, | ||
transaction_text, | ||
filer_name, | ||
filer_relation, | ||
money_text, | ||
start_date, | ||
ownership, | ||
value as total_value | ||
|
||
from source | ||
|
||
) | ||
|
||
select * from renamed |
24 changes: 24 additions & 0 deletions
24
models/staging/stocks/stg_stocks__recommendation_trends.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
with | ||
|
||
source as ( | ||
|
||
select * from {{ source('stocks', 'recommendation_trends') }} | ||
|
||
), | ||
|
||
renamed as ( | ||
|
||
select | ||
symbol, | ||
period, | ||
strong_buy, | ||
buy, | ||
hold, | ||
sell, | ||
strong_sell | ||
|
||
from source | ||
|
||
) | ||
|
||
select * from renamed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
with | ||
|
||
source as ( | ||
|
||
select * from {{ source('stocks', 'sec_filings') }} | ||
|
||
), | ||
|
||
renamed as ( | ||
|
||
select | ||
symbol, | ||
date as report_date, | ||
epoch_date, | ||
type, | ||
title, | ||
edgar_url | ||
|
||
from source | ||
|
||
) | ||
|
||
select * from renamed |