https://prefect.io logo
a

ale

04/14/2022, 5:35 PM
Hey folks 👋 Are there any guidelines to “convert” existing Prefect 1.0 tasks to make them work with Prefect 2.0?
a

Anna Geller

04/14/2022, 5:37 PM
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

ale

04/14/2022, 5:38 PM
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

Anna Geller

04/18/2022, 10:48 AM
That's awesome! I'm sure @alex can help with the review.
a

alex

04/18/2022, 1:30 PM
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

ale

04/20/2022, 3:26 PM
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

alex

04/20/2022, 3:36 PM
Can you send me a link to the deployed documentation?
a

ale

04/20/2022, 3:39 PM
Sure, let me find it and will send it to you 😅
Where can I find the URL of the generated Github Pages?
a

alex

04/20/2022, 3:48 PM
I think this quickstart will give you the info you need: https://docs.github.com/en/pages/quickstart
a

ale

04/20/2022, 3:49 PM
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

alex

04/20/2022, 4:20 PM
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

ale

04/20/2022, 4:44 PM
Working on it
Done!
a

alex

04/20/2022, 7:06 PM
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

ale

04/20/2022, 7:07 PM
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

alex

04/21/2022, 6:22 PM
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

ale

04/21/2022, 8:13 PM
Should be fixed now
a

alex

04/22/2022, 4:25 PM
Looks great! I’m going to start working on getting this collection listed in the catalog!
upvote 1
🙌 1
15 Views