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

python: Command hierarchy revamp #156

Merged
merged 1 commit into from
Mar 11, 2021
Merged

Conversation

da-tanabe
Copy link
Contributor

@da-tanabe da-tanabe commented Feb 26, 2021

python: Prepare the Command classes for the new v8 API (#108).

  • Rename CreateCommand/CreateAndExerciseCommand/ExerciseCommand/ExerciseByKeyCommand fields to match the properties as they exist in the JavaScript ledger bindings (https://docs.daml.com/app-dev/bindings-ts/daml-ledger/classes/_index_.ledger.html).
  • Split these classes into dazl.protocols.commands.*Command, and deprecated counterparts in dazl.clients.commands.*Command that are meant to help with the v8 transition but will be removed in v9.
  • Remove usage of dataclass in Command, as dataclasses don't have a particularly straightforward way of deprecating fields.

@da-tanabe da-tanabe force-pushed the python-reduce-dataclass-usage branch 2 times, most recently from 05103a5 to 441e7cb Compare February 26, 2021 03:06
@da-tanabe da-tanabe marked this pull request as draft February 26, 2021 15:51
@da-tanabe da-tanabe force-pushed the python-reduce-dataclass-usage branch from 441e7cb to 2a7292b Compare March 11, 2021 03:40
@da-tanabe da-tanabe changed the title python: Make dazl.model.writing.Command classes NOT data classes. python: Command hierarchy revamp Mar 11, 2021
@da-tanabe da-tanabe force-pushed the python-reduce-dataclass-usage branch 8 times, most recently from b28ac34 to 10e4458 Compare March 11, 2021 04:03
@da-tanabe da-tanabe force-pushed the python-reduce-dataclass-usage branch from 10e4458 to c834675 Compare March 11, 2021 04:11
@da-tanabe da-tanabe marked this pull request as ready for review March 11, 2021 13:52
Comment on lines +479 to +481
with warnings.catch_warnings():
warnings.simplefilter("ignore", DeprecationWarning)
cb = CommandBuilder.coerce(commands, atomic_default=True)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've said this before, but I think I really like this pattern for managing warnings.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed—this is something that Python does rather well.

@da-tanabe da-tanabe merged commit 0d760ce into master Mar 11, 2021
@da-tanabe da-tanabe deleted the python-reduce-dataclass-usage branch March 11, 2021 15:46
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

Successfully merging this pull request may close these issues.

2 participants