-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
197f14b
commit 3f3b432
Showing
28 changed files
with
3,367 additions
and
126 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,5 @@ | ||
from .fake_graphql_server import endpoints | ||
|
||
__all__ = [ | ||
"endpoints", | ||
] |
35 changes: 35 additions & 0 deletions
35
tests/dbt/cloud/fake_graphql_server/fake_graphql_server.py
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,35 @@ | ||
from tests.dbt.cloud.fake_graphql_server.get_environment_adapter_type.endpoint import ( | ||
fake_GetEnvironmentAdapterType, | ||
) | ||
from tests.dbt.cloud.fake_graphql_server.get_job_run_macros.endpoint import ( | ||
fake_GetJobRunMacros, | ||
) | ||
from tests.dbt.cloud.fake_graphql_server.get_job_run_metrics.endpoint import ( | ||
fake_GetJobRunMetrics, | ||
) | ||
from tests.dbt.cloud.fake_graphql_server.get_job_run_models.endpoint import ( | ||
fake_GetJobRunModels, | ||
) | ||
from tests.dbt.cloud.fake_graphql_server.get_job_run_snapshots.endpoint import ( | ||
fake_GetJobRunSnapshots, | ||
) | ||
from tests.dbt.cloud.fake_graphql_server.get_job_run_sources.endpoint import ( | ||
fake_GetJobRunSources, | ||
) | ||
from tests.dbt.cloud.fake_graphql_server.get_job_run_tests.endpoint import ( | ||
fake_GetJobRunTests, | ||
) | ||
from tests.dbt.cloud.fake_graphql_server.get_macro_arguments.endpoint import ( | ||
fake_GetMacroArguments, | ||
) | ||
|
||
endpoints = { | ||
"GetEnvironmentAdapterType": fake_GetEnvironmentAdapterType, | ||
"GetJobRunMacros": fake_GetJobRunMacros, | ||
"GetJobRunMetrics": fake_GetJobRunMetrics, | ||
"GetJobRunModels": fake_GetJobRunModels, | ||
"GetJobRunSnapshots": fake_GetJobRunSnapshots, | ||
"GetJobRunSources": fake_GetJobRunSources, | ||
"GetJobRunTests": fake_GetJobRunTests, | ||
"GetMacroArguments": fake_GetMacroArguments, | ||
} |
Empty file.
9 changes: 9 additions & 0 deletions
9
tests/dbt/cloud/fake_graphql_server/get_environment_adapter_type/endpoint.py
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,9 @@ | ||
import os | ||
from typing import Any, Dict | ||
|
||
dir_path = os.path.dirname(os.path.realpath(__file__)) | ||
|
||
|
||
def fake_GetEnvironmentAdapterType(variables: Dict[str, Any]): | ||
with open(f"{dir_path}/jaffle_shop.json") as f: | ||
return f.read() |
6 changes: 6 additions & 0 deletions
6
tests/dbt/cloud/fake_graphql_server/get_environment_adapter_type/jaffle_shop.json
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,6 @@ | ||
{ | ||
"environment": { | ||
"adapterType": "snowflake", | ||
"dbtProjectName": "jaffle_shop" | ||
} | ||
} |
Empty file.
9 changes: 9 additions & 0 deletions
9
tests/dbt/cloud/fake_graphql_server/get_job_run_macros/endpoint.py
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,9 @@ | ||
import os | ||
from typing import Any, Dict | ||
|
||
dir_path = os.path.dirname(os.path.realpath(__file__)) | ||
|
||
|
||
def fake_GetJobRunMacros(variables: Dict[str, Any]): | ||
with open(f"{dir_path}/jaffle_shop.json") as f: | ||
return f.read() |
1,286 changes: 1,286 additions & 0 deletions
1,286
tests/dbt/cloud/fake_graphql_server/get_job_run_macros/jaffle_shop.json
Large diffs are not rendered by default.
Oops, something went wrong.
Empty file.
9 changes: 9 additions & 0 deletions
9
tests/dbt/cloud/fake_graphql_server/get_job_run_metrics/endpoint.py
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,9 @@ | ||
import os | ||
from typing import Any, Dict | ||
|
||
dir_path = os.path.dirname(os.path.realpath(__file__)) | ||
|
||
|
||
def fake_GetJobRunMetrics(variables: Dict[str, Any]): | ||
with open(f"{dir_path}/jaffle_shop.json") as f: | ||
return f.read() |
278 changes: 278 additions & 0 deletions
278
tests/dbt/cloud/fake_graphql_server/get_job_run_metrics/jaffle_shop.json
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,278 @@ | ||
{ | ||
"job": { | ||
"metrics": [ | ||
{ | ||
"packageName": "jaffle_shop", | ||
"label": "Cumulative Revenue (All Time)", | ||
"description": "The cumulative revenue for all orders.", | ||
"dependsOn": [ | ||
"semantic_model.jaffle_shop.order_items" | ||
], | ||
"uniqueId": "metric.jaffle_shop.cumulative_revenue", | ||
"timeGrains": [], | ||
"timestamp": null, | ||
"dimensions": [], | ||
"filters": [], | ||
"tags": [], | ||
"type": "cumulative", | ||
"sql": null, | ||
"expression": null, | ||
"calculation_method": "cumulative" | ||
}, | ||
{ | ||
"packageName": "jaffle_shop", | ||
"label": "Customers w/ Orders", | ||
"description": "Distict count of customers placing orders", | ||
"dependsOn": [ | ||
"semantic_model.jaffle_shop.orders" | ||
], | ||
"uniqueId": "metric.jaffle_shop.customers_with_orders", | ||
"timeGrains": [], | ||
"timestamp": null, | ||
"dimensions": [], | ||
"filters": [], | ||
"tags": [], | ||
"type": "simple", | ||
"sql": null, | ||
"expression": null, | ||
"calculation_method": "simple" | ||
}, | ||
{ | ||
"packageName": "jaffle_shop", | ||
"label": "Food Orders", | ||
"description": "Count of orders that contain food order items", | ||
"dependsOn": [ | ||
"semantic_model.jaffle_shop.orders" | ||
], | ||
"uniqueId": "metric.jaffle_shop.food_orders", | ||
"timeGrains": [], | ||
"timestamp": null, | ||
"dimensions": [], | ||
"filters": [], | ||
"tags": [], | ||
"type": "simple", | ||
"sql": null, | ||
"expression": null, | ||
"calculation_method": "simple" | ||
}, | ||
{ | ||
"packageName": "jaffle_shop", | ||
"label": "Food Revenue", | ||
"description": "The revenue from food in each order", | ||
"dependsOn": [ | ||
"semantic_model.jaffle_shop.order_items" | ||
], | ||
"uniqueId": "metric.jaffle_shop.food_revenue", | ||
"timeGrains": [], | ||
"timestamp": null, | ||
"dimensions": [], | ||
"filters": [], | ||
"tags": [], | ||
"type": "simple", | ||
"sql": null, | ||
"expression": null, | ||
"calculation_method": "simple" | ||
}, | ||
{ | ||
"packageName": "jaffle_shop", | ||
"label": "Food Revenue %", | ||
"description": "The % of order revenue from food.", | ||
"dependsOn": [ | ||
"metric.jaffle_shop.food_revenue", | ||
"metric.jaffle_shop.revenue" | ||
], | ||
"uniqueId": "metric.jaffle_shop.food_revenue_pct", | ||
"timeGrains": [], | ||
"timestamp": null, | ||
"dimensions": [], | ||
"filters": [], | ||
"tags": [], | ||
"type": "ratio", | ||
"sql": null, | ||
"expression": null, | ||
"calculation_method": "ratio" | ||
}, | ||
{ | ||
"packageName": "jaffle_shop", | ||
"label": "Large Orders", | ||
"description": "Count of orders with order total over 20.", | ||
"dependsOn": [ | ||
"semantic_model.jaffle_shop.orders" | ||
], | ||
"uniqueId": "metric.jaffle_shop.large_order", | ||
"timeGrains": [], | ||
"timestamp": null, | ||
"dimensions": [], | ||
"filters": [], | ||
"tags": [], | ||
"type": "simple", | ||
"sql": null, | ||
"expression": null, | ||
"calculation_method": "simple" | ||
}, | ||
{ | ||
"packageName": "jaffle_shop", | ||
"label": "Locations", | ||
"description": "Count of locations that placed in order.", | ||
"dependsOn": [ | ||
"semantic_model.jaffle_shop.orders" | ||
], | ||
"uniqueId": "metric.jaffle_shop.locations", | ||
"timeGrains": [], | ||
"timestamp": null, | ||
"dimensions": [], | ||
"filters": [], | ||
"tags": [], | ||
"type": "simple", | ||
"sql": null, | ||
"expression": null, | ||
"calculation_method": "simple" | ||
}, | ||
{ | ||
"packageName": "jaffle_shop", | ||
"label": "Median Revenue", | ||
"description": "The median revenue for each order item. Excludes tax.", | ||
"dependsOn": [ | ||
"semantic_model.jaffle_shop.order_items" | ||
], | ||
"uniqueId": "metric.jaffle_shop.median_revenue", | ||
"timeGrains": [], | ||
"timestamp": null, | ||
"dimensions": [], | ||
"filters": [], | ||
"tags": [], | ||
"type": "simple", | ||
"sql": null, | ||
"expression": null, | ||
"calculation_method": "simple" | ||
}, | ||
{ | ||
"packageName": "jaffle_shop", | ||
"label": "New Customers", | ||
"description": "Unique count of new customers.", | ||
"dependsOn": [ | ||
"semantic_model.jaffle_shop.orders" | ||
], | ||
"uniqueId": "metric.jaffle_shop.new_customer", | ||
"timeGrains": [], | ||
"timestamp": null, | ||
"dimensions": [], | ||
"filters": [], | ||
"tags": [], | ||
"type": "simple", | ||
"sql": null, | ||
"expression": null, | ||
"calculation_method": "simple" | ||
}, | ||
{ | ||
"packageName": "jaffle_shop", | ||
"label": "Order Cost", | ||
"description": "Sum of cost for each order item.", | ||
"dependsOn": [ | ||
"semantic_model.jaffle_shop.orders" | ||
], | ||
"uniqueId": "metric.jaffle_shop.order_cost", | ||
"timeGrains": [], | ||
"timestamp": null, | ||
"dimensions": [], | ||
"filters": [], | ||
"tags": [], | ||
"type": "simple", | ||
"sql": null, | ||
"expression": null, | ||
"calculation_method": "simple" | ||
}, | ||
{ | ||
"packageName": "jaffle_shop", | ||
"label": "Order Gross Profit", | ||
"description": "Gross profit from each order.", | ||
"dependsOn": [ | ||
"metric.jaffle_shop.order_cost", | ||
"metric.jaffle_shop.revenue" | ||
], | ||
"uniqueId": "metric.jaffle_shop.order_gross_profit", | ||
"timeGrains": [], | ||
"timestamp": null, | ||
"dimensions": [], | ||
"filters": [], | ||
"tags": [], | ||
"type": "derived", | ||
"sql": null, | ||
"expression": null, | ||
"calculation_method": "derived" | ||
}, | ||
{ | ||
"packageName": "jaffle_shop", | ||
"label": "Orders", | ||
"description": "Count of orders.", | ||
"dependsOn": [ | ||
"semantic_model.jaffle_shop.orders" | ||
], | ||
"uniqueId": "metric.jaffle_shop.orders", | ||
"timeGrains": [], | ||
"timestamp": null, | ||
"dimensions": [], | ||
"filters": [], | ||
"tags": [], | ||
"type": "simple", | ||
"sql": null, | ||
"expression": null, | ||
"calculation_method": "simple" | ||
}, | ||
{ | ||
"packageName": "jaffle_shop", | ||
"label": "Order Total", | ||
"description": "Sum of total order amonunt. Includes tax + revenue.", | ||
"dependsOn": [ | ||
"semantic_model.jaffle_shop.orders" | ||
], | ||
"uniqueId": "metric.jaffle_shop.order_total", | ||
"timeGrains": [], | ||
"timestamp": null, | ||
"dimensions": [], | ||
"filters": [], | ||
"tags": [], | ||
"type": "simple", | ||
"sql": null, | ||
"expression": null, | ||
"calculation_method": "simple" | ||
}, | ||
{ | ||
"packageName": "jaffle_shop", | ||
"label": "Revenue", | ||
"description": "Sum of the product revenue for each order item. Excludes tax.", | ||
"dependsOn": [ | ||
"semantic_model.jaffle_shop.order_items" | ||
], | ||
"uniqueId": "metric.jaffle_shop.revenue", | ||
"timeGrains": [], | ||
"timestamp": null, | ||
"dimensions": [], | ||
"filters": [], | ||
"tags": [], | ||
"type": "simple", | ||
"sql": null, | ||
"expression": null, | ||
"calculation_method": "simple" | ||
}, | ||
{ | ||
"packageName": "jaffle_shop", | ||
"label": "Revenue Growth % M/M", | ||
"description": "Percentage growth of revenue compared to 1 month ago. Excluded tax", | ||
"dependsOn": [ | ||
"metric.jaffle_shop.revenue" | ||
], | ||
"uniqueId": "metric.jaffle_shop.revenue_growth_mom", | ||
"timeGrains": [], | ||
"timestamp": null, | ||
"dimensions": [], | ||
"filters": [], | ||
"tags": [], | ||
"type": "derived", | ||
"sql": null, | ||
"expression": null, | ||
"calculation_method": "derived" | ||
} | ||
] | ||
} | ||
} |
Empty file.
9 changes: 9 additions & 0 deletions
9
tests/dbt/cloud/fake_graphql_server/get_job_run_models/endpoint.py
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,9 @@ | ||
import os | ||
from typing import Any, Dict | ||
|
||
dir_path = os.path.dirname(os.path.realpath(__file__)) | ||
|
||
|
||
def fake_GetJobRunModels(variables: Dict[str, Any]): | ||
with open(f"{dir_path}/jaffle_shop.json") as f: | ||
return f.read() |
Oops, something went wrong.