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

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

Open
DavidRicharz opened this issue Nov 7, 2024 · 0 comments

Comments

@DavidRicharz
Copy link

DavidRicharz commented Nov 7, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant