Skip to content

Commit

Permalink
dagster-census api docs (#12413)
Browse files Browse the repository at this point in the history
### Summary & Motivation
adds `dagster-census` api doc page

### How I Tested These Changes

https://dagster-git-yuhan-02-16-dagster-censusapidocs-elementl.vercel.app/_apidocs/libraries/dagster-census
  • Loading branch information
yuhan authored and clairelin135 committed Feb 22, 2023
1 parent 27808ac commit 314b968
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 16 deletions.
4 changes: 4 additions & 0 deletions docs/content/_navigation.json
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,10 @@
"title": "Celery + Kubernetes (dagster-celery-k8s)",
"path": "/_apidocs/libraries/dagster-celery-k8s"
},
{
"title": "Census (dagster-census)",
"path": "/_apidocs/libraries/dagster-census"
},
{
"title": "Dask (dagster-dask)",
"path": "/_apidocs/libraries/dagster-dask"
Expand Down
2 changes: 1 addition & 1 deletion docs/content/api/modules.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/content/api/searchindex.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/content/api/sections.json

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions docs/content/integrations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ Explore libraries that are maintained by the Dagster core team.
title="Celery + Docker"
href="/_apidocs/libraries/dagster-celery-docker"
></ArticleListItem>
<ArticleListItem
title="Census"
href="/_apidocs/libraries/dagster-census"
></ArticleListItem>
<ArticleListItem
title="Dask"
href="/_apidocs/libraries/dagster-dask"
Expand Down
Binary file modified docs/next/public/objects.inv
Binary file not shown.
1 change: 1 addition & 0 deletions docs/sphinx/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"../../python_modules/libraries/dagster-azure",
"../../python_modules/libraries/dagster-celery",
"../../python_modules/libraries/dagster-celery-docker",
"../../python_modules/libraries/dagster-census",
"../../python_modules/libraries/dagster-dask",
"../../python_modules/libraries/dagster-datadog",
"../../python_modules/libraries/dagster-datahub",
Expand Down
1 change: 1 addition & 0 deletions docs/sphinx/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
sections/api/apidocs/libraries/dagster-celery
sections/api/apidocs/libraries/dagster-celery-docker
sections/api/apidocs/libraries/dagster-celery-k8s
sections/api/apidocs/libraries/dagster-census
sections/api/apidocs/libraries/dagster-dask
sections/api/apidocs/libraries/dagster-databricks
sections/api/apidocs/libraries/dagster-datadog
Expand Down
18 changes: 18 additions & 0 deletions docs/sphinx/sections/api/apidocs/libraries/dagster-census.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Census (dagster-census)
-----------------------

This library provides an integration with Census.

.. currentmodule:: dagster_census

.. autoconfigurable:: census_trigger_sync_op
:annotation: OpDefinition

.. autoconfigurable:: census_resource
:annotation: ResourceDefinition

.. autoclass:: CensusResource
:members:

.. autoclass:: CensusOutput
:members:
21 changes: 11 additions & 10 deletions python_modules/libraries/dagster-census/dagster_census/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"sync_id": Field(
int,
is_required=True,
description="id of the parent sync.",
description="Id of the parent sync.",
),
"force_full_sync": Field(
config=Bool,
Expand All @@ -32,13 +32,13 @@
"poll_interval": Field(
float,
default_value=DEFAULT_POLL_INTERVAL,
description="The time (in seconds) that will be waited between successive polls.",
description="The time (in seconds) to wait between successive polls.",
),
"poll_timeout": Field(
Noneable(float),
default_value=None,
description=(
"The maximum time that will waited before this operation is timed out. By "
"The maximum time to wait before this operation is timed out. By "
"default, this will never time out."
),
),
Expand All @@ -62,16 +62,17 @@
tags={"kind": "census"},
)
def census_trigger_sync_op(context):
"""
Executes a Census sync for a given ``sync_id``, and polls until that sync
completes, raising an error if it is unsuccessful. It outputs a CensusOutput which contains
the details of the Census sync after the sync successfully completes, as well as details
about which tables the sync updates.
"""Executes a Census sync for a given ``sync_id`` and polls until that sync completes, raising
an error if it is unsuccessful.
It outputs a :py:class:`~dagster_census.CensusOutput` which contains the details of the Census
sync after it successfully completes.
It requires the use of the :py:class:`~dagster_census.census_resource`, which allows it to
communicate with the census API.
communicate with the Census API.
**Examples:**
Examples:
.. code-block:: python
from dagster import job
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class CensusOutput(
Attributes:
sync_run (Dict[str, Any]):
The details of the specific sync run
The details of the specific sync run.
source (Dict[str, Any]):
Information about the source for the Census sync
Information about the source for the Census sync.
destination (Dict[str, Any]):
Information about the destination for the Census sync
Information about the destination for the Census sync.
"""

0 comments on commit 314b968

Please sign in to comment.