liferoad commented on issue #35769:
URL: https://github.com/apache/beam/issues/35769#issuecomment-3146102808

   run this:
   ```
   python -m apache_beam.yaml.main --yaml_pipeline_file 
./test_ml_transform.yaml --yaml_experimental_features ML
   ```
   after installing `sentence-transformers`.
   We can reproduce this error with the stacktrace:
   ```
   INFO:apache_beam.yaml.yaml_transform:Expanding "MapToFieldsAfterEmbedding" 
at line 20
   Traceback (most recent call last):
     File 
"/usr/local/google/home/xqhu/Dev/beam/sdks/python/apache_beam/yaml/yaml_mapping.py",
 line 648, in normalize_fields
       input_schema = dict(named_fields_from_element_type(pcoll.element_type))
     File 
"/usr/local/google/home/xqhu/Dev/beam/sdks/python/apache_beam/typehints/schemas.py",
 line 639, in named_fields_from_element_type
       return named_fields_from_schema(schema_from_element_type(element_type))
     File 
"/usr/local/google/home/xqhu/Dev/beam/sdks/python/apache_beam/typehints/schemas.py",
 line 631, in schema_from_element_type
       raise TypeError(
   TypeError: Could not determine schema for type hint Any. Did you mean to 
create a schema-aware PCollection? See https://s.apache.org/beam-python-schemas
   
   The above exception was the direct cause of the following exception:
   
   Traceback (most recent call last):
     File 
"/usr/local/google/home/xqhu/Dev/beam/sdks/python/apache_beam/yaml/yaml_transform.py",
 line 506, in expand_leaf_transform
       outputs = inputs | scope.unique_name(spec, ptransform) >> ptransform
     File 
"/usr/local/google/home/xqhu/Dev/beam/sdks/python/apache_beam/pvalue.py", line 
138, in __or__
       return self.pipeline.apply(ptransform, self)
     File 
"/usr/local/google/home/xqhu/Dev/beam/sdks/python/apache_beam/pipeline.py", 
line 722, in apply
       return self.apply(
     File 
"/usr/local/google/home/xqhu/Dev/beam/sdks/python/apache_beam/pipeline.py", 
line 733, in apply
       return self.apply(transform, pvalueish)
     File 
"/usr/local/google/home/xqhu/Dev/beam/sdks/python/apache_beam/pipeline.py", 
line 813, in apply
       pvalueish_result = self.runner.apply(transform, pvalueish, self._options)
     File 
"/usr/local/google/home/xqhu/Dev/beam/sdks/python/apache_beam/runners/runner.py",
 line 191, in apply
       return self.apply_PTransform(transform, input, options)
     File 
"/usr/local/google/home/xqhu/Dev/beam/sdks/python/apache_beam/runners/runner.py",
 line 195, in apply_PTransform
       return transform.expand(input)
     File 
"/usr/local/google/home/xqhu/Dev/beam/sdks/python/apache_beam/yaml/yaml_transform.py",
 line 423, in recording_expand
       result = original_expand(pvalue)
     File 
"/usr/local/google/home/xqhu/Dev/beam/sdks/python/apache_beam/transforms/ptransform.py",
 line 1031, in expand
       return self._fn(pcoll, *args, **kwargs)
     File 
"/usr/local/google/home/xqhu/Dev/beam/sdks/python/apache_beam/yaml/yaml_errors.py",
 line 72, in expand
       return transform_fn(wrapped_pcoll, **kwargs).as_result(
     File 
"/usr/local/google/home/xqhu/Dev/beam/sdks/python/apache_beam/yaml/yaml_mapping.py",
 line 709, in _PyJsMapToFields
       input_schema, fields = normalize_fields(
     File 
"/usr/local/google/home/xqhu/Dev/beam/sdks/python/apache_beam/yaml/yaml_mapping.py",
 line 655, in normalize_fields
       raise ValueError("Can only use expressions on a schema'd input.") from 
exn
   ValueError: Can only use expressions on a schema'd input.
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@beam.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to