Hey folks :wave: Are there any guidelines to “conv...
# prefect-contributors
a
Hey folks 👋 Are there any guidelines to “convert” existing Prefect 1.0 tasks to make them work with Prefect 2.0?
a
Hi Ale, great question! I asked Chris about it - we will have more concrete guidelines for that later. For now, we have a guide on how you can contribute to Prefect Collections discussed here.
a
Thanks Anna! 🙌
🙌 1
After digging into the code and other collections I was able to setup a
prefect-cubejs
collection on my local environment 😊 Here you can find the code! What are the next steps to submit the code into Prefect repo?
a
That's awesome! I'm sure @alex can help with the review.
a
Hey @ale! Thanks so much for creating a Prefect Collection! Here’s are the next steps I recommend for `prefect-cubejs`: • Ensure that your code has good unit test coverage. You can check this by running
coverage run --branch -m pytest tests
. We recommend at least 80% coverage. • Make sure that all the documentation is updated. This includes the docstrings in your Python code and README.md since they are used to generate your documentation. You can run
mkdocs serve
to view the generated documentation. • Publish a version of
prefect-cubejs
on PyPI.
You can do this automatically by creating a tag in GitHub with a v prefix (e.g. v0.1.0). This will create a release on PyPI and also publish the autogenerated docs to GitHub Pages. You’ll need a PyPI to to publish to PyPI and you can refer to MAINTAINERS.md in your repo for more information. Once you’ve completed the initial release, we can work together to get
prefect-cubejs
listed in the Prefect Collections Catalog. If you run into any issues, let me know and I’ll be happy to help!
a
Hey @alex 👋 Thanks for the detailed instructions! I was able to release the very first version of
prefect-cubejs
on PyPi 🎉 https://pypi.org/project/prefect-cubejs/
🎉 2
Is there anything else I need to do?
a
Can you send me a link to the deployed documentation?
a
Sure, let me find it and will send it to you 😅
Where can I find the URL of the generated Github Pages?
a
I think this quickstart will give you the info you need: https://docs.github.com/en/pages/quickstart
a
I discovered Github Pages was disabled on my repo. I’ve enabled it now, but I think I need to run the action again
a
Nice! Looks like the docstring on
run_query
need to be filled in. Can you you add a docstring that documents the arguments, return type, and examples for the task similar to these tasks here: https://github.com/PrefectHQ/prefect-slack/blob/main/prefect_slack/messages.py?
👍 1
a
Working on it
Done!
a
Nice! In order to deploy the updated docs you’ll need to push the changes to the docs branch. Here’s a workflow that you can include in your project to deploy a new version of the docs: https://github.com/PrefectHQ/prefect-slack/blob/main/.github/workflows/publish-docs.yml. That workflow can be triggered manually from the GitHub Actions UI. Also, I noticed references to
prefect.engine.signals.FAIL
in the new docstring, but I think that should be
CubeJSAPIFailureException
.
a
Will check it, thanks @alex 🙌
Docstrings have been fixed and published to Github Pages 🙌
@alex please let me know if there's anything else I need to fix/improve
a
It looks like mkdocs is having trouble parsing the docstring on your task. I think that you can remove the typing from the docstring (e.g.
(str, optional)
) since mkdocs can pull typing info from the type hints on your function. If you want to experiment with changes to the documentation on your local you can run
mkdocs serve
which will rebuild the docs each time you make a change.
👍 1
a
Should be fixed now
a
Looks great! I’m going to start working on getting this collection listed in the catalog!
upvote 1
🙌 1