https://dagster.io/ logo
#ask-community
Title
# ask-community
t

Tobias Pankrath

03/21/2023, 10:57 AM
Is it possible to get a list of partitions via the cli?
dagster bot responded by community 1
v

Vinnie

03/21/2023, 1:25 PM
Don’t think the CLI supports that directly, but you could do something like
python -c 'from dagster import DynamicPartitionsDefinition, DagsterInstance; DynamicPartitionsDefinition(name="some_name").get_partitions(dynamic_partitions_store=DagsterInstance.get())'
❤️ 1
I should mention I didn’t test this directly, but I believe it could work Just tested, this would work:
python -c 'from dagster import DynamicPartitionsDefinition, DagsterInstance; print([i.name for i in DynamicPartitionsDefinition(name="some_name").get_partitions(dynamic_partitions_store=DagsterInstance.get())])'
t

Tobias Pankrath

03/21/2023, 2:13 PM
Thanks, that's searches for my "dagster instance" the same way
dagster dev
would?
v

Vinnie

03/21/2023, 2:16 PM
I don’t know how
dagster dev
works under the hood, but I assume so. The way I understand it, your
DagsterInstance
is just what’s configured by your
dagster.yaml
. https://github.com/dagster-io/dagster/blob/797702019f0ef5ff3a1d377ffd29ae503022cfd5/python_modules/dagster/dagster/_core/instance/__init__.py#L275
3 Views