Skip to content
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

Tutorial updates #117

Merged
merged 10 commits into from
Jul 20, 2023
Merged

Tutorial updates #117

merged 10 commits into from
Jul 20, 2023

Conversation

Olajumoke01
Copy link
Collaborator

Updated version of the airbnb tutorial with missing code and commands. I think all the code in the tutorial should be working now. I added comments to the ssg manual edit file, to make it clearer which lines were added.


$ sqlsynthgen make-stats --config-file config.yaml --force

This will generate a file with the results of your sql queries from config.yaml and these results will be stored in the variable ``SRC_STATS``.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would reword this. Something like: "With this command, the results of the query defined in config.yaml will be stored in the src-stats.yaml file. If you recreate the generators, stored in ssg.py, you can verify that the query results are exposed via the SRC_STATS variable.

This will generate a file with the results of your sql queries from config.yaml and these results will be stored in the variable ``SRC_STATS``.
From there they can be passed to your generators as arguments.

In this example ``user_age_provider``, the ``query_results`` argument represents the results of the ``age_stats`` query and returns a random age value.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for clarity, I would reword it like: "Within the function user_age_provider, defined in airbnb_generators.py, the ..."

pyproject.toml Outdated
@@ -25,6 +25,7 @@ sqlacodegen = "3.0.0rc1"
asyncpg = "^0.27.0"
greenlet = "^2.0.2"
pymysql = "^1.1.0"
pre-commit = {version = "^3.3.3", extras = ["dev"]}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this dependency added?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I asked Olajumoke to add it because we use pre-commit checks and have a config file for it. This came up when I suggested that she run pre-commit install, but she needed to install pre-commit first. It's unrelated to any of the other changes in this PR, just came up at the same time.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense :)

@cptanalatriste
Copy link
Collaborator

@Olajumoke01 is looking good: I just made some minor suggestions. Also, if you still have them, it would be nice to add the complete config.yaml and airbnb_generators.py files to the tutorial.

Copy link
Collaborator

@cptanalatriste cptanalatriste left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor changes, that I flagged as comments.

@Olajumoke01
Copy link
Collaborator Author

@Olajumoke01 is looking good: I just made some minor suggestions. Also, if you still have them, it would be nice to add the complete config.yaml and airbnb_generators.py files to the tutorial.

Hey @cptanalatrist, Do you mean add them near to the end of the tutorial as an example or as separate files somewhere?

@cptanalatriste
Copy link
Collaborator

cptanalatriste commented Jul 14, 2023

@Olajumoke01 is looking good: I just made some minor suggestions. Also, if you still have them, it would be nice to add the complete config.yaml and airbnb_generators.py files to the tutorial.

Hey @cptanalatrist, Do you mean add them near to the end of the tutorial as an example or as separate files somewhere?

Maybe you can add the files to the airbnb folder, and later add a paragraph at the end of the tutorial that goes: "The complete files generated as part of this tutorial are available at this location."

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please rename the file to be all lowecase?

Copy link
Collaborator

@cptanalatriste cptanalatriste left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Only a minor renaming request.

@Iain-S
Copy link
Collaborator

Iain-S commented Jul 19, 2023

only one thing, as discussed with Markus:

  • move pre-commit dep from an extra to the dev group

@mhauru mhauru merged commit bbe7b3c into main Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants