I'm trying to use a standard example for automl. I would expect the create_model to launch a long running operation that will update the operation response once it's done and to then access the metadata (to get the model_id of the newly trained model) . but the script fails right away on metadata = response.metadata()
with "TypeError: 'OperationMetadata' object is not callable"
.
I'm running this code inside a PythonOperator in Airflow/google composer if it makes any difference. I can see in the AutoML UI that the model starts training correctly.
My code is this, but it's basically the example usage that's in the docs.:
from google.cloud import automl
client = automl.AutoMlClient()
...
response = client.create_model(project_location, my_model)
def callback(operation_future):
# Handle result.
result = operation_future.result()
response.add_done_callback(callback)
metadata = response.metadata()
I'm using google-cloud-automl==0.9.0