-
I have a simple integration test case that looks like this:
This is the Service code.
The question is about this piece of code: Is this on expected lines ? Should I be explicitly passing a I was hoping NOT because even the minimal BentoService IrisClassifier example in the Getting Started guide seems to suggest that input lists are converted into Dataframes.
Could I be doing something wrong ? What is the best strategy for coding integration tests ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @jiyer2016 - I think the other thread here #1067 probably answered your question here. Adapters do not take effect when calling directly with the Python API. import pandas as pd
iris_classifier_service.predict(pd.DataFrame([[5.1, 3.5, 1.4, 0.2]])) We could potentially make this work and convert arrays to Dataframe for the user, and we actually tried out a version with that approach when building the initial version of BentoML. But users tend to find that approach more confusing, as they expect the BentoService class method should just work the same way how a regular python class method works when being invoked. We can potentially add a special method for invoking APIs from Python and adding an additional method to InputAdapter class for converting a Python object into the argument expected by the user-defined API function. E.g.
Although I'm not sure how much value that would add. Thoughts? |
Beta Was this translation helpful? Give feedback.
Hey @jiyer2016 - I think the other thread here #1067 probably answered your question here. Adapters do not take effect when calling directly with the Python API.
DataframeInput
for example, will need the user to provide apandas.DataFrame
object as its input, the quick start example with iris classifier should be used as follow:We could potentially make this work and convert arrays to Dataframe for the user, and we actually tried out a version with that approach when building the initial version of BentoML. But users tend to find that approach more confusing, as they expect the BentoService class me…