Skip to content

GSK-2426 only run core.core.CallableMeta.extract_doc when necessary#1776

Merged
kevinmessiaen merged 7 commits intomainfrom
GSK-2426
Feb 20, 2024
Merged

GSK-2426 only run core.core.CallableMeta.extract_doc when necessary#1776
kevinmessiaen merged 7 commits intomainfrom
GSK-2426

Conversation

@kevinmessiaen
Copy link
Copy Markdown
Member

Description

Made doc attribute of CallableMeta a cached property so that it is only initialised when accessing the value (ei. uploading meta to the Hub)

Related Issue

Type of Change

  • 📚 Examples / docs / tutorials / dependencies update
  • 🔧 Bug fix (non-breaking change which fixes an issue)
  • 🥂 Improvement (non-breaking change which improves an existing feature)
  • 🚀 New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 🔐 Security fix

@linear
Copy link
Copy Markdown

linear Bot commented Feb 1, 2024

@kevinmessiaen kevinmessiaen requested review from Hartorn and removed request for andreybavt February 19, 2024 02:14
@Inokinoki Inokinoki self-requested a review February 19, 2024 09:11
Copy link
Copy Markdown
Member

@Inokinoki Inokinoki left a comment

Choose a reason for hiding this comment

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

LGTM, tested locally:

>>> from giskard.testing.tests.llm import test_llm_char_injection
>>> test_llm_char_injection.meta
<giskard.core.core.TestFunctionMeta object at 0x15cdf6f80>
>>> test_llm_char_injection.meta.doc
2024-02-19 12:20:22,387 pid:14093 MainThread giskard.core.core WARNING  Unexpected documentation element for test_llm_char_injection: DocstringSectionKind.admonition
<giskard.core.core.CallableDocumentation object at 0x100d3fe80>

@sonarqubecloud
Copy link
Copy Markdown

@kevinmessiaen kevinmessiaen merged commit 6f9bc5f into main Feb 20, 2024
@kevinmessiaen kevinmessiaen deleted the GSK-2426 branch February 20, 2024 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants