Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class DataModuleConfig(TypedDict):

class ImagePrompt(BaseModel):

data_format: Literal["b64_json", "bytes", "url"]
data_format: Literal["b64_json", "bytes", "url", "path"]
Copy link
Contributor

Choose a reason for hiding this comment

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

high

While this change correctly adds the path option to data_format, the new functionality is not covered by any tests. To ensure correctness and prevent future regressions, please add a test case for data_format: "path" in tests/plugins_tests/test_io_processor_plugins.py. You could add a new test function or parameterize an existing one to handle the path case, for example by downloading the test image to a temporary file and passing its path.

Copy link
Contributor

Choose a reason for hiding this comment

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

high

The "bytes" option in data_format appears to be non-functional. The load_image function in prithvi_processor.py expects a list of strings, but for data_format="bytes" it would receive a list containing a bytes object. The logic to handle bytes data within load_image is commented out, and read_geotiff is not called correctly for this case. This will lead to a runtime error. Since you are modifying this line, it would be beneficial to either fix the implementation for "bytes" or remove it from the Literal to avoid confusion.

"""
This is the data type for the input image
"""
Expand Down