HyukjinKwon commented on code in PR #56654:
URL: https://github.com/apache/spark/pull/56654#discussion_r3455691841


##########
python/pyspark/sql/tests/connect/test_connect_context.py:
##########
@@ -14,6 +14,12 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
+# PEP 563: make annotations lazy strings so any annotation referencing a
+# grpc-only connect type is never evaluated at class-definition time. The
+# connect.context imports below are guarded by should_test_connect, so on a
+# classic-only / no-grpc image those names are undefined; lazy annotations keep
+# module collection from raising NameError there.
+from __future__ import annotations

Review Comment:
   Good point - done. Quoted the annotation (`-> "SQLContext"`) in 
`test_parity_sql_context.py` and dropped `from __future__ import annotations` 
from both files. `test_connect_context.py` has no connect-type annotations (the 
connect classes are only referenced inside method bodies), so the 
`should_test_connect` guard alone keeps it collectable on grpc-less images.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to