File tree Expand file tree Collapse file tree 5 files changed +23
-1
lines changed
Expand file tree Collapse file tree 5 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,15 @@ deploy: ## Deploy the entire stack
6464 make dbt
6565 @echo " Deployment completed successfully. Run 'make app' to view the app."
6666
67+ debug : # # Clean up everything and redeploy to fix bugs
68+ @echo " Running debug cleanup and redeploy..."
69+ snow sql -c localstack -q " USE DATABASE FACTORY_PIPELINE_DEMO; USE SCHEMA PUBLIC; DROP FILE FORMAT IF EXISTS csv_format;"
70+ snow sql -c localstack -q " DROP PIPE IF EXISTS FACTORY_PIPELINE_DEMO.PUBLIC.SENSOR_DATA_PIPE;"
71+ snow sql -c localstack -q " DROP TABLE IF EXISTS FACTORY_PIPELINE_DEMO.PUBLIC_RAW.SENSOR_DATA;"
72+ awslocal s3 rb s3://factory-sensor-data-local --force
73+ make deploy
74+ @echo " Debug cleanup and redeploy completed successfully."
75+
6776test : # # Run tests
6877 @echo " Running tests..."
6978 bash -c " source env/bin/activate && pytest tests/"
@@ -90,4 +99,4 @@ ready: ## Make sure the LocalStack container is up
9099logs : # # Save the logs in a separate file
91100 @localstack logs > logs.txt
92101
93- .PHONY : install seed aws upload pipeline dbt app deploy test start stop ready logs
102+ .PHONY : install seed aws upload pipeline dbt app deploy test start stop ready logs debug
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ version: 2
22
33models :
44 - name : processed_machine_health
5+ tests :
6+ - table_not_empty
57 description : " Final processed machine health metrics"
68 columns :
79 - name : machine_id
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ version: 2
22
33models :
44 - name : sensor_readings_view
5+ tests :
6+ - table_not_empty
57 description : " Cleaned and validated sensor readings"
68 columns :
79 - name : machine_id
Original file line number Diff line number Diff line change @@ -17,6 +17,11 @@ CREATE OR REPLACE TABLE RAW_SENSOR_DATA (
1717-- Create a file format for CSV files
1818CREATE OR REPLACE FILE FORMAT csv_format
1919 TYPE = CSV
20+ -- 🐛 DEMO BUG: Incorrect CSV delimiter configuration
21+ -- The actual CSV file uses commas, not semicolons.
22+ -- This mismatch causes data parsing to fail in dbt test "table_not_empty"
23+ -- Snowpipe will fail to parse CSV data correctly and Streamlit app shows no data
24+ -- FIELD_DELIMITER = ';' -- 🚨 BUG: Causes "RAW_SENSOR_DATA" table to remain empty
2025 FIELD_DELIMITER = ' ,'
2126 SKIP_HEADER = 1
2227 NULL_IF = (' NULL' , ' null' )
Original file line number Diff line number Diff line change 1+ {% test table_not_empty(model) %}
2+ select 1 as id
3+ where not exists (select 1 from {{ model }} limit 1 )
4+ {% endtest %}
You can’t perform that action at this time.
0 commit comments