()
| 76 | |
| 77 | |
| 78 | def test_list_format(): |
| 79 | arr = pa.array([["foo"], None, ["bar", "a longer string", None]]) |
| 80 | result = arr.to_string() |
| 81 | expected = """\ |
| 82 | [ |
| 83 | [ |
| 84 | "foo" |
| 85 | ], |
| 86 | null, |
| 87 | [ |
| 88 | "bar", |
| 89 | "a longer string", |
| 90 | null |
| 91 | ] |
| 92 | ]""" |
| 93 | assert result == expected |
| 94 | |
| 95 | result = arr.to_string(element_size_limit=10) |
| 96 | expected = """\ |
| 97 | [ |
| 98 | [ |
| 99 | "foo" |
| 100 | ], |
| 101 | null, |
| 102 | [ |
| 103 | "bar", |
| 104 | "a longer (... 7 chars omitted)", |
| 105 | null |
| 106 | ] |
| 107 | ]""" |
| 108 | assert result == expected |
| 109 | |
| 110 | |
| 111 | def test_string_format(): |