Is it possible to get a list of partitions via the...
# ask-community
t
Is it possible to get a list of partitions via the cli?
dagster bot responded by community 1
v
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
Thanks, that's searches for my "dagster instance" the same way
dagster dev
would?
v
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