-
Notifications
You must be signed in to change notification settings - Fork 7
Halyna R. #10
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
Open
halyna1995
wants to merge
2
commits into
HackYourAssignment:main
Choose a base branch
from
halyna1995:week11/halyna
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Halyna R. #10
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 |
|---|---|---|
| @@ -1,4 +1,6 @@ | ||
| # PostgreSQL connection string (your Week 9/10 login) | ||
| POSTGRES_URL=postgresql://pipeline_user:your-pg-password@your-pg-host:5432/team1 | ||
| # Keep the database name as team1 and the ?sslmode=require suffix; only swap | ||
| # in your own user, password, and host. | ||
| POSTGRES_URL=postgresql://your-pg-user:your-pg-password@your-pg-host:5432/team1?sslmode=require | ||
| # Your dev schema name (e.g. dev_jana) | ||
| DB_SCHEMA=dev_yourname | ||
| DB_SCHEMA=dev_yourname |
This file contains hidden or 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
This file contains hidden or 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,72 @@ | ||
| # Metric definitions | ||
|
|
||
| Five fields per metric: Name, Description, Calculation, Data source, Refresh frequency. One block per panel. Copy this file to `metric_definitions.md` inside your `week11-streamlit/` folder and fill it in. | ||
|
|
||
| ## Metabase panels | ||
|
|
||
| <!-- One block per Question: trip count by payment type, average fare per | ||
| mile by dropoff borough, average trip duration by hour of day. --> | ||
|
|
||
| ### Panel 1: Trip Count by Payment Type | ||
|
|
||
| - **Name**: `trip_count_by_payment_type` | ||
| - **Description**: Number of taxi trips grouped by payment type. This shows which payment methods are used most often in the dataset. | ||
| - **Calculation**: `COUNT(*)` grouped by `payment_type_label` | ||
| - **Data source**: `dev_halyna.fct_trips` | ||
| - **Refresh frequency**: Updated when the `fct_trips` mart is rebuilt. Metabase reads the current database table when the dashboard is opened. | ||
|
|
||
| ### Panel 2: Average Fare per Mile by Dropoff Borough | ||
|
|
||
| - **Name**: `avg_fare_per_mile_by_dropoff_borough` | ||
| - **Description**: Average fare charged per mile, grouped by the borough where the trip ended. Unit: US dollars per mile. | ||
| - **Calculation**: `AVG(fare_per_mile)` grouped by `dropoff_borough` | ||
| - **Data source**: `dev_halyna.fct_trips` | ||
| - **Refresh frequency**: Updated when the `fct_trips` mart is rebuilt. Metabase reads the current database table when the dashboard is opened. | ||
|
|
||
| ### Panel 3: Average Trip Duration by Hour | ||
|
|
||
| - **Name**: `avg_trip_duration_by_pickup_hour` | ||
| - **Description**: Average trip duration in minutes, grouped by pickup hour of day. This shows how trip duration changes during the day. | ||
| - **Calculation**: `AVG(EXTRACT(EPOCH FROM (dropoff_datetime - pickup_datetime)) / 60)` grouped by `EXTRACT(HOUR FROM pickup_datetime)` | ||
| - **Data source**: `dev_halyna.fct_trips` | ||
| - **Refresh frequency**: Updated when the `fct_trips` mart is rebuilt. Metabase reads the current database table when the dashboard is opened. | ||
|
|
||
| ## Streamlit panels | ||
|
|
||
| <!-- Headline KPIs panel: total trips, average trip distance, average | ||
| fare per mile. --> | ||
|
|
||
| ### Panel 1: Headline KPIs | ||
|
|
||
| - **Name**: `headline_kpis` | ||
| - **Description**: Three headline metrics for the selected payment type: total trips, average trip distance, and average fare per mile. | ||
| - **Calculation**: | ||
| - `total_trips`: `COUNT(*)` | ||
| - `avg_trip_distance`: `AVG(trip_distance)` | ||
| - `avg_fare_per_mile`: `AVG(fare_per_mile)` | ||
| - If a payment type is selected, the query adds `WHERE payment_type_label = selected_payment_type`. | ||
| - **Data source**: `dev_halyna.fct_trips` | ||
| - **Refresh frequency**: Streamlit caches the query result for 300 seconds using `@st.cache_data(ttl=300)`. The underlying data updates when the `fct_trips` mart is rebuilt. | ||
|
|
||
| ### Panel 2: Trips by Pickup Hour | ||
|
|
||
| - **Name**: `trip_count_by_pickup_hour` | ||
| - **Description**: Number of taxi trips grouped by pickup hour of day. This shows the daily demand pattern across the 24-hour cycle. | ||
| - **Calculation**: `COUNT(*)` grouped by `EXTRACT(HOUR FROM pickup_datetime)`. If a payment type is selected, the query adds `WHERE payment_type_label = selected_payment_type`. | ||
| - **Data source**: `dev_halyna.fct_trips` | ||
| - **Refresh frequency**: Streamlit caches the query result for 300 seconds using `@st.cache_data(ttl=300)`. The underlying data updates when the `fct_trips` mart is rebuilt. | ||
|
|
||
| ### Panel 3: Data Freshness | ||
|
|
||
| - **Name**: `data_freshness` | ||
| - **Description**: Data-quality panel showing the number of rows available and the latest pickup timestamp in the selected dataset. | ||
| - **Calculation**: | ||
| - `row_count`: `COUNT(*)` | ||
| - `last_pickup`: `MAX(pickup_datetime)` | ||
| - If a payment type is selected, the query adds `WHERE payment_type_label = selected_payment_type`. | ||
| - **Data source**: `dev_halyna.fct_trips` | ||
| - **Refresh frequency**: Streamlit caches the query result for 300 seconds using `@st.cache_data(ttl=300)`. The underlying data updates when the `fct_trips` mart is rebuilt. | ||
|
|
||
| <!-- Add more ### Panel blocks under either section if you build more (the Required tier adds | ||
| an hour-of-day trend and a freshness panel to Streamlit; a Metabase date filter is Extra, | ||
| bonus credit, not required). --> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.