Feat: Adding a tutorial for the Iowa Liquor dataset#419
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
| @@ -0,0 +1,1026 @@ | |||
| { | |||
There was a problem hiding this comment.
Line #2. from datetime import datetime
I am not sure if you actually made use of datetime in your code. If not, flake8 will warn you and you can delete this line.
Reply via ReviewNB
|
|
||
| artifact: | ||
| title: "Iowa Liquor sales predictions" | ||
| description: "Predict a liquor sales price based previous years sales data using a tree based ML estimators such as Random Forest" |
There was a problem hiding this comment.
lint is complaining about line 17: 17:16 [colons] too many spaces after colon
| import pandas as pd | ||
| mock_client = mock.MagicMock() | ||
| mock_df = pd.DataFrame() | ||
| mock_df['week'] = range(50) |
There was a problem hiding this comment.
You want to change mock_df. These lines are added, so our test code does not make an actual request to BigQuery. Instead, we "mock" the BQ call, and create a mock object (in this case, mock_df) to be the object we pretend that our BQ call returned. You want it to be a dataframe that you expect the BQ call returns, so the rest of your code can function and work properly.
| dataframe = tb.get("dataframe") | ||
| assert dataframe.shape == (50, 3) | ||
|
|
||
| train_pred_plot = tb.get("train_pred_plot") |
There was a problem hiding this comment.
You want to pick an object from your code (ideally something from the end of your code) and replace train_pred_plot with it, and test whether it exists or not. That way, we are testing whether your notebook runs all the way to the end during the test.
reducing the librarires
reducing spaces after columns
…orm#419) * putting my files with docs * changing my project id * flake8 passed on notebook & test * reducing spaces in files names * reformatting the artifact * Update artifact.yaml reducing the librarires * Update artifact.yaml reducing spaces after columns * Adding test file and notebook Co-authored-by: Edouard Gahou <edouardg@google.com>
Description
Note: If you are adding or editing a dataset, please specify the dataset folder involved, e.g.
datasets/google_trendsChecklist
Use the sections below based on what's applicable to your PR and delete the rest:
Feature
READMEaccordinglyData Onboarding
datasets/<DATASET_NAME>and nothing outside of that directoryDocumentation
Bug fix
testsfolder)Code cleanup or refactoring