Эх сурвалжийг харах

fix(tests): hive-ddl-gen 末字段无逗号断言用缩进定位字段行

原 filter 'STRING' in line 误命中 PARTITIONED BY (dt STRING) 导致
field_lines 多收一行;改 filter 为 l.startswith('    '),只取 4 空格
缩进的字段定义行。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
tianyu.chu 1 долоо хоног өмнө
parent
commit
28ed4d3741

+ 1 - 1
tests/unit/datax/test_hive_ddl_gen.py

@@ -130,7 +130,7 @@ def test_render_raw_ddl_single_quote_in_comment_escaped():
 
 def test_render_raw_ddl_last_column_no_trailing_comma():
     out = GEN.render_raw_ddl('t', ['a', 'b'], {})
-    field_lines = [l for l in out.split('\n') if 'STRING' in l]
+    field_lines = [l for l in out.split('\n') if l.startswith('    ')]
     assert len(field_lines) == 2
     assert 'STRING,' in field_lines[0]
     assert 'STRING,' not in field_lines[1]