()
| 121 | |
| 122 | |
| 123 | def test_join_args(): |
| 124 | left = T( |
| 125 | """a |
| 126 | 1 |
| 127 | 2""" |
| 128 | ) |
| 129 | right = left.copy() |
| 130 | |
| 131 | with _assert_error_trace( |
| 132 | ValueError, |
| 133 | match=re.escape( |
| 134 | "Received `how` argument but was not expecting any.\n" |
| 135 | + "Consider using a generic join method that handles `how` to decide on a type of a join to be used." |
| 136 | ), |
| 137 | ): |
| 138 | left.join_left(right, how=pw.JoinMode.LEFT) # cause |
| 139 | |
| 140 | with _assert_error_trace( |
| 141 | ValueError, |
| 142 | match=re.escape( |
| 143 | "Received `how` argument of join that is a string.\n" |
| 144 | + "You probably want to use one of JoinMode.INNER, JoinMode.LEFT," |
| 145 | + " JoinMode.RIGHT or JoinMode.OUTER values." |
| 146 | ), |
| 147 | ): |
| 148 | left.join(right, how="left") # cause |
| 149 | |
| 150 | with _assert_error_trace( |
| 151 | ValueError, |
| 152 | match=re.escape( |
| 153 | "How argument of join should be one of JoinMode.INNER, JoinMode.LEFT," |
| 154 | + " JoinMode.RIGHT or JoinMode.OUTER values." |
| 155 | ), |
| 156 | ): |
| 157 | left.join(right, how=1) # cause |
| 158 | |
| 159 | with _assert_error_trace( |
| 160 | ValueError, |
| 161 | match=re.escape("The id argument of a join has to be a ColumnReference."), |
| 162 | ): |
| 163 | left.join(right, id=1) # cause |
| 164 | |
| 165 | with _assert_error_trace( |
| 166 | ValueError, |
| 167 | match=re.escape( |
| 168 | "Join received extra kwargs.\n" |
| 169 | + "You probably want to use TableLike.join(...).select(**kwargs) to compute output columns." |
| 170 | ), |
| 171 | ): |
| 172 | left.join(right, a=left.a) # cause |
| 173 | |
| 174 | |
| 175 | def test_session_simple(): |
nothing calls this directly
no test coverage detected