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

Create File resource with a file-like object #238

Merged
merged 2 commits into from
Nov 14, 2023

Conversation

FedericoNegri
Copy link
Contributor

@FedericoNegri FedericoNegri commented Nov 6, 2023

Description

The File resource now supports specifying passing a file-like object as src (alternatively to a file path). For instance:

File(
   name="file-object",
   evaluation_path="my-file.txt",
   type="text/plain",
   src=io.StringIO("this is a file"),
)

Checklist

Please complete the following checklist before submitting your pull request:

  • I have tested these changes locally and verified that they work as intended.
  • I have updated any documentation as needed to reflect these changes (if appropriate)
  • I have verified that these changes to the best of my knowledge do not introduce any security vulnerabilities.
  • Unit tests have been added (if appropriate)
  • Test-cases have been added (if appropriate)
  • Testing instructions have been added (if appropriate)

@FedericoNegri FedericoNegri linked an issue Nov 6, 2023 that may be closed by this pull request
@FedericoNegri FedericoNegri marked this pull request as ready for review November 6, 2023 17:16
@FedericoNegri FedericoNegri merged commit b5499dc into main Nov 14, 2023
10 checks passed
@FedericoNegri FedericoNegri deleted the fnegri/file_like_object branch November 15, 2023 12:42
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.

Support file creation with file-like-objects and string
2 participants