Skip to content

Add support for calling fiddle tagging methods inside auto_config functions.#90

Open
copybara-service[bot] wants to merge 1 commit intomainfrom
test_466052435
Open

Add support for calling fiddle tagging methods inside auto_config functions.#90
copybara-service[bot] wants to merge 1 commit intomainfrom
test_466052435

Conversation

@copybara-service
Copy link
Copy Markdown

Add support for calling fiddle tagging methods inside auto_config functions.

When the auto_config function is run using as_buildable, the tagging methods work as normal. E.g.:

  • MyTag.new(x) returns TaggedValueCls([MyTag], x).
  • fdl.add_tag(cfg, 'arg', MyTag) adds the tag MyTag to cfg.arg.
  • fdl.get_tags(cfg, 'arg') returns the tags for cfg.arg.

When the auto_config function is run using call, the tagging methods are no-ops. E.g.:

  • MyTag.new(x) returns x.
  • fdl.add_tag(cfg, arg, MyTag) does nothing and returns None.
  • fdl.get_tags(cfg, arg) returns an empty frozenset.

…ctions.

When the auto_config function is run using as_buildable, the tagging methods work as normal.  E.g.:
- MyTag.new(x) returns TaggedValueCls([MyTag], x).
- fdl.add_tag(cfg, 'arg', MyTag) adds the tag MyTag to cfg.arg.
- fdl.get_tags(cfg, 'arg') returns the tags for cfg.arg.

When the auto_config function is run using __call__, the tagging methods are no-ops.  E.g.:
- MyTag.new(x) returns x.
- fdl.add_tag(cfg, arg, MyTag) does nothing and returns None.
- fdl.get_tags(cfg, arg) returns an empty frozenset.

PiperOrigin-RevId: 466052435
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.

1 participant