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

Kyle

07/02/2022, 4:03 PM
hi all, i'm new to dagster and trying to test a schedule on a partitioned asset. below is my
repo.py
following the code example from the documentation:
Copy code
from dagster import repository, asset, DailyPartitionsDefinition, define_asset_job, build_schedule_from_partitioned_job, HourlyPartitionsDefinition

@asset(partitions_def=HourlyPartitionsDefinition(start_date="2022-05-31", fmt="%Y-%m-%d"))
def test_asset():
    pass

partitioned_asset_job = define_asset_job(
    "partitioned_job",
    selection="*",
    partitions_def=HourlyPartitionsDefinition(start_date="2022-05-31", fmt="%Y-%m-%d"),
)


asset_partitioned_schedule = build_schedule_from_partitioned_job(
    partitioned_asset_job,
)
@repository
def deploy_docker_repository():
    return [asset_partitioned_schedule, test_asset]
When I run the above with
dagit -f repo.py
, the repo failed to load with below message:
Copy code
dagster._check.CheckError: Invariant failed. Description: Duplicate definition found for partitioned_job_partition_set
  File "/usr/local/lib/python3.7/site-packages/dagster/grpc/server.py", line 227, in __init__
    self._container_image,
  File "/usr/local/lib/python3.7/site-packages/dagster/grpc/server.py", line 117, in __init__
    repo_def.load_all_definitions()
  File "/usr/local/lib/python3.7/site-packages/dagster/core/definitions/repository_definition.py", line 1121, in load_all_definitions
    self._repository_data.load_all_definitions()
  File "/usr/local/lib/python3.7/site-packages/dagster/core/definitions/repository_definition.py", line 414, in load_all_definitions
    self.get_all_partition_sets()
  File "/usr/local/lib/python3.7/site-packages/dagster/core/definitions/repository_definition.py", line 951, in get_all_partition_sets
    return self._partition_sets.get_all_definitions()
  File "/usr/local/lib/python3.7/site-packages/dagster/core/definitions/repository_definition.py", line 147, in get_all_definitions
    map(self.get_definition, self.get_definition_names()),
  File "/usr/local/lib/python3.7/site-packages/dagster/core/definitions/repository_definition.py", line 128, in get_definition_names
    f"Duplicate definition found for {definition.name}",
  File "/usr/local/lib/python3.7/site-packages/dagster/_check/__init__.py", line 1455, in invariant
    raise CheckError(f"Invariant failed. Description: {desc}")
Wondering if anyone can point me on whether I'm doing wrong? The version is 0.15.3. Thanks in advance!
c

chris

07/02/2022, 11:11 PM
Hrm this looks like a bug with how the repository is loaded. Made an issue to track this, should get a fix out within the next few releases.
👍 1
6 Views