Skip to content

AttributeError: 'Synchronizer' object has no attribute 'target_configs' #17

Open
@DavidRicharz

Description

I get an error from the Synchronizer class method syncComponent:
AttributeError: 'Synchronizer' object has no attribute 'target_configs'

Expected behavior: The data element handed to syncComponent is copied over to my target property

# minimum viable example for replication
import launchpy as lp

lp.importConfigFile("config.json")
admin = lp.Admin()
properties = admin.getProperties(admin.getCompanyId())
base, target = lp.Property(properties[0]), lp.Property(properties[1])
synchronizor = lp.Synchronizer(base.name, [target.name])
myDataElementNameExample = "[Origin] Constant" #Arbitrary name of a data element or rule to copy
synchronizor.syncComponent(myDataElementNameExample) # -> AttributeError: 'Synchronizer' object has no attribute 'target_configs'

The README doesn't mention the need to have a target_configs set up via setDynamicFiltering. I also don't understand how the filter is supposed to work based on the README.

The issue can be remedied using setDynamicFiltering but neither the error thrown nor the function signatures suggest this is even necessary:

...
myRules = [
    {
        "name": "myName",
        "targetProperties": target.name,
        "exclComponents": [],
        "inclComponents": [],
    }
]

synchronizor.dynamicFiltering(myRules)
...
synchronizor.syncComponent(myDataElementNameExample) # now it works

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions