From 3eac02c9ae074e08db5ec74ed87785005c1ec1cf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20Kl=C3=B6ckner?= <inform@tiker.net>
Date: Fri, 10 Jun 2022 12:42:11 -0500
Subject: [PATCH] Add comment to warn against early exits from freeze

---
 arraycontext/impl/pytato/__init__.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arraycontext/impl/pytato/__init__.py b/arraycontext/impl/pytato/__init__.py
index aacfd82..de027e6 100644
--- a/arraycontext/impl/pytato/__init__.py
+++ b/arraycontext/impl/pytato/__init__.py
@@ -296,6 +296,10 @@ class PytatoPyOpenCLArrayContext(_BasePytatoArrayContext):
                     raise TypeError(f"{type(self).__name__}.freeze invoked "
                                     f"with non-pytato array of type '{type(array)}'")
 
+                # Don't be tempted to take shortcuts here, e.g. for empty
+                # arrays, as this will inhibit metadata propagation that
+                # may happen in transform_dag below. See
+                # https://github.com/inducer/arraycontext/pull/167#issuecomment-1151877480
                 key_to_pt_arrays[key] = subary
 
         # }}}
-- 
GitLab