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

[wip][docs] Generate + include apidocs for components #27930

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 0 additions & 88 deletions docs/content-templates/concept.md

This file was deleted.

36 changes: 0 additions & 36 deletions docs/content-templates/example-reference.md

This file was deleted.

32 changes: 0 additions & 32 deletions docs/content-templates/guide-no-steps.md

This file was deleted.

39 changes: 0 additions & 39 deletions docs/content-templates/guide-with-steps.md

This file was deleted.

59 changes: 59 additions & 0 deletions docs/docs/api/components/dbt_project@dagster_components.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@

## Component: `dagster_components.dbt_project`

### Description:
Expose a DBT project to Dagster as a set of assets.

### Sample Component Params:

```yaml
type: dagster_components.dbt_project

params:
dbt:
project_dir: '...'
global_config_flags:
- '...'
profiles_dir: '...'
profile: '...'
target: '...'
dbt_executable: '...'
state_path: '...'
op:
name: '...'
tags: {}
asset_attributes: # Available scope: {'node'}
deps: # Available scope: {'node'}
- '...' # Available scope: {'node'}
description: '...' # Available scope: {'node'}
metadata: '...' # Available scope: {'node'}
group_name: '...' # Available scope: {'node'}
skippable: false # Available scope: {'node'}
code_version: '...' # Available scope: {'node'}
owners: # Available scope: {'node'}
- '...' # Available scope: {'node'}
tags: '...' # Available scope: {'node'}
kinds: # Available scope: {'node'}
- '...' # Available scope: {'node'}
automation_condition: '...' # Available scope: {'node'}
key: '...' # Available scope: {'node'}
transforms:
- target: '...'
operation: '...'
attributes:
deps:
- '...'
description: '...'
metadata: '...'
group_name: '...'
skippable: false
code_version: '...'
owners:
- '...'
tags: '...'
kinds:
- '...'
automation_condition: '...'
key: '...'

```
15 changes: 15 additions & 0 deletions docs/docs/api/components/definitions@dagster_components.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

## Component: `dagster_components.definitions`

### Description:
Wraps an arbitrary set of Dagster definitions.

### Sample Component Params:

```yaml
type: dagster_components.definitions

params:
definitions_path: '...'

```
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

## Component: `dagster_components.pipes_subprocess_script_collection`

### Description:
Assets that wrap Python scripts executed with Dagster's PipesSubprocessClient.

### Sample Component Params:

```yaml
type: dagster_components.pipes_subprocess_script_collection

params:
scripts:
- path: '...'
assets:
- deps:
- '...'
description: '...'
metadata: '...'
group_name: '...'
skippable: false
code_version: '...'
owners:
- '...'
tags: '...'
kinds:
- '...'
automation_condition: '...'
key: '...'

```
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@

## Component: `dagster_components.sling_replication_collection`

### Description:
Expose one or more Sling replications to Dagster as assets.

### Sample Component Params:

```yaml
type: dagster_components.sling_replication_collection

params:
sling:
connections:
- name: '...'
type: '...'
connection_string: '...'
replications:
- path: '...'
op:
name: '...'
tags: {}
asset_attributes: # Available scope: {'stream_definition'}
deps: # Available scope: {'stream_definition'}
- '...' # Available scope: {'stream_definition'}
description: '...' # Available scope: {'stream_definition'}
metadata: '...' # Available scope: {'stream_definition'}
group_name: '...' # Available scope: {'stream_definition'}
skippable: false # Available scope: {'stream_definition'}
code_version: '...' # Available scope: {'stream_definition'}
owners: # Available scope: {'stream_definition'}
- '...' # Available scope: {'stream_definition'}
tags: '...' # Available scope: {'stream_definition'}
kinds: # Available scope: {'stream_definition'}
- '...' # Available scope: {'stream_definition'}
automation_condition: '...' # Available scope: {'stream_definition'}
key: '...' # Available scope: {'stream_definition'}
transforms:
- target: '...'
operation: '...'
attributes:
deps:
- '...'
description: '...'
metadata: '...'
group_name: '...'
skippable: false
code_version: '...'
owners:
- '...'
tags: '...'
kinds:
- '...'
automation_condition: '...'
key: '...'

```
17 changes: 17 additions & 0 deletions docs/scripts/build-components-docs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from pathlib import Path

from dagster_dg.component import RemoteComponentRegistry
from dagster_dg.context import DgContext
from dagster_dg.docs import markdown_for_component_type

dg_context = DgContext.default()
registry = RemoteComponentRegistry.from_dg_context(dg_context)

for key in registry.global_keys():
markdown = markdown_for_component_type(registry.get_global(key))

component_md_path = (
Path(__file__).parent.parent / "docs" / "api" / "components" / f"{key.to_typename()}.md"
)
component_md_path.parent.mkdir(parents=True, exist_ok=True)
component_md_path.write_text(markdown)
Loading
Loading