-
Notifications
You must be signed in to change notification settings - Fork 80
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Python: omission of Optional field leads to Attribute Error in validate_conditions #2185
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
Comments
I've discussed this with @chrisisla and he suggested to raise an issue, and highlight this with you. Can you please have a look at it, and revert? If you need any more information, just let me know. Many thanks! |
One might argue that the Python function is behaving as expected since the definition of the condition makes reference to an attribute of an optional field rather than checking whether that field is defined first. The Rosetta definition of the condition is: `condition RateOptionObservable: ...
The condition should have tested for the existence of observable first. IE
It is possible for the generator to compensate but a stronger solution would be more rigorous checking of the Rosetta. |
How do we proceed with this? I don't think that someone should amend these conditions on a case per case basis, but changing them all at once is a massive change, which requires thorough analysis, execution and testing. Please advice. |
Hi @RonAtCFX We've discussed this and came to the conclusion that the Python code generator should implement the same semantics as the Java code generator. In this case, that means that the Python code for the path operator |
@SimonCockx |
We’re in agreement to support it even though its an odd syntax.
There’s no explicit timing but we are looking into it. Will revert once there’s a plan.
From: Ron Kaim ***@***.***>
Date: Tuesday, June 20, 2023 at 9:34 AM
To: finos/common-domain-model ***@***.***>
Cc: dschwartznyc ***@***.***>, Mention ***@***.***>
Subject: Re: [finos/common-domain-model] Python: omission of Optional field leads to Attribute Error in validate_conditions (Issue #2185)
@SimonCockx<https://github.com/SimonCockx>
many thanks for your prompt response. any planning when this will be delivered?
—
Reply to this email directly, view it on GitHub<#2185 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ADD3X6DH3CEUGHQNRVOZLQ3XMGRGZANCNFSM6AAAAAAZDMIRXA>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Hi @RonAtCFX I hope this message finds you well! I'm following up on your question and wanted to check if it's okay to close now and if you've received your answer. If you haven’t and want to keep it open please let me know. If you're interested in joining the Contribution Review Working Group (CRWG) meetings, we have sessions scheduled for tomorrow, February 6th at 10 am EST/3 pm GMT, and another on February 20th at the same time and we can discuss your questions directly with the maintainers. Please let me know your preferences or if you have any further questions or concerns. Looking forward to hearing from you! |
Hi @RonAtCFX Closing this issue out because it has been open for more than 30 days with no activity. Please reopen if necessary and feel free to reach out to the CDM team if you have any questions. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Uh oh!
There was an error while loading. Please reload this page.
Hi,
I'm testing the recently released python libs, version dev.50
In a PriceQuantity, the attribute "observable" is optional.
so I created a PriceQuantity, without an "observable":
when calling the validate_conditions() on the PriceQuantity, python raises a AttributeError:
this is on this test instruction:
Is this something erroneous on my side, or is the generated python code incorrect of incomplete?
The text was updated successfully, but these errors were encountered: