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

Function support #68

Merged
merged 14 commits into from
Dec 14, 2023
Merged

Function support #68

merged 14 commits into from
Dec 14, 2023

Conversation

jaredoconnell
Copy link
Contributor

@jaredoconnell jaredoconnell commented Dec 6, 2023

Changes introduced with this PR

This PR adds functions to the schema.

There are two main categories of functions. Statically typed and dynamically typed.

  • The way that the dynamically typed functions are implemented mean that we still validate their type, but a little looser using a function that determines the type after the input parameters are passed in.
  • Dynamically typed functions allow functions that support more generic things, like creating an object with specific fields.
  • The statically typed functions are validated strictly. You pass in the function handler, and it's validated at runtime.
  • The allowed return types for a standard function may or may not include an error return. This error return is in addition to the single return specified by the schema, if present.

For examples on how this is used, see the expressions draft PR: arcalot/arcaflow-expressions#16


By contributing to this repository, I agree to the contribution guidelines.

webbnh

This comment was marked as resolved.

Copy link

@dbutenhof dbutenhof left a comment

Choose a reason for hiding this comment

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

Just some comments, mostly on messaging...

schema/function.go Outdated Show resolved Hide resolved
schema/function.go Outdated Show resolved Hide resolved
schema/function.go Outdated Show resolved Hide resolved
schema/function.go Outdated Show resolved Hide resolved
webbnh

This comment was marked as resolved.

webbnh

This comment was marked as resolved.

webbnh

This comment was marked as resolved.

@jaredoconnell

This comment was marked as resolved.

Copy link
Contributor

@webbnh webbnh left a comment

Choose a reason for hiding this comment

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

Looks good. I just have a couple of questions and a couple of suggestions (which you can consider or ignore if don't have any other changes to make).

schema/function_test.go Show resolved Hide resolved
schema/function.go Outdated Show resolved Hide resolved
schema/function.go Outdated Show resolved Hide resolved
schema/function.go Outdated Show resolved Hide resolved
schema/function_test.go Show resolved Hide resolved
@jaredoconnell jaredoconnell merged commit fd302bb into main Dec 14, 2023
3 checks passed
@jaredoconnell jaredoconnell deleted the function-support branch December 14, 2023 22:03
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.

None yet

4 participants