Skip to content

Conversation

@kevinmessiaen
Copy link
Member

Description

Fixed doc format of QueryBasedSliceFunction

image

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

Checklist

  • I've read the CODE_OF_CONDUCT.md document.
  • I've read the CONTRIBUTING.md guide.
  • I've updated the code style using make codestyle.
  • I've written tests for all new methods and classes that I created.
  • I've written the docstring in Google format for all the methods and classes that I used.
Copy link
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.

Nice catch!

At very first, I tried to catch the parsing issue in python-doc.utils.ts Hub frontend like:

export function extractArgumentDocumentation(callable: CallableDTO | null): ParsedDocstring {
  if (!callable?.doc) {
    return { body: '', args: {} };
  }

  try {
    let parsedDoc = JSON.parse(callable.doc);
    return {
      body: parsedDoc.description ?? '',
      args: parsedDoc.parameters ?? {},
    };
  } catch (e) {
    // Doc is a pure text
    return {
      body: callable.doc,
      args: {},
    }
  }
}

And the DB migration from Bazire saved me.

I think the yours is a promising way to prevent future issues.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 6, 2023

@kevinmessiaen kevinmessiaen merged commit f2ba817 into main Dec 6, 2023
@kevinmessiaen kevinmessiaen deleted the feature/gsk-2328-uploaded-querybasedslicefunction-have-a-wrong-doc-format branch December 6, 2023 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants