robertwb commented on code in PR #33208:
URL: https://github.com/apache/beam/pull/33208#discussion_r1868535527


##########
sdks/python/apache_beam/yaml/yaml_transform.py:
##########
@@ -955,10 +955,37 @@ def preprocess_languages(spec):
     else:
       return spec
 
+  def validate_transform_references(spec):
+    if 'transforms' not in spec:
+      return spec
+
+    for transform in spec['transforms']:
+      name = transform.get('name')
+      inputs = transform.get('input')
+      if name is None or inputs is None:

Review Comment:
   What about references to self by type? Should we lent name = 
`transform.get('name', tranform.get('type'))`?



##########
sdks/python/apache_beam/yaml/yaml_transform.py:
##########
@@ -955,10 +955,37 @@ def preprocess_languages(spec):
     else:
       return spec
 
+  def validate_transform_references(spec):
+    if 'transforms' not in spec:
+      return spec
+
+    for transform in spec['transforms']:
+      name = transform.get('name')
+      inputs = transform.get('input')
+      if name is None or inputs is None:
+        continue
+
+      input_values = []

Review Comment:
   Let's put this phase after normalize_inputs_outputs to avoid duplicating 
this logic here. 



##########
sdks/python/apache_beam/yaml/yaml_transform.py:
##########
@@ -955,10 +955,37 @@ def preprocess_languages(spec):
     else:
       return spec
 
+  def validate_transform_references(spec):
+    if 'transforms' not in spec:
+      return spec
+
+    for transform in spec['transforms']:
+      name = transform.get('name')
+      inputs = transform.get('input')
+      if name is None or inputs is None:
+        continue
+
+      input_values = []
+      if isinstance(inputs, str):
+        input_values = [inputs]
+      elif isinstance(inputs, list):
+        input_values = inputs
+      elif isinstance(inputs, dict):
+        input_values = list(inputs.values())
+
+      for input_value in input_values:
+        if isinstance(input_value, str) and input_value.lower() == 
name.lower():

Review Comment:
   We aren't case insensitively on our matching, are we? 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to