(self, val)
| 144 | # |
| 145 | |
| 146 | def parse_val(self, val): |
| 147 | if isinstance(val, str): |
| 148 | if not self.include_literals: |
| 149 | return {'_type': 'Terminal'} |
| 150 | return { |
| 151 | '_type': 'String', |
| 152 | 's': val, |
| 153 | } |
| 154 | elif isinstance(val, list): |
| 155 | return { |
| 156 | '_type': 'ColUnit', |
| 157 | 'c': self.parse_col_unit(val), |
| 158 | } |
| 159 | elif isinstance(val, float): |
| 160 | if not self.include_literals: |
| 161 | return {'_type': 'Terminal'} |
| 162 | return { |
| 163 | '_type': 'Number', |
| 164 | 'f': val, |
| 165 | } |
| 166 | elif isinstance(val, dict): |
| 167 | return { |
| 168 | '_type': 'ValSql', |
| 169 | 's': self.parse_sql(val), |
| 170 | } |
| 171 | else: |
| 172 | raise ValueError(val) |
| 173 | |
| 174 | def parse_col_unit(self, col_unit): |
| 175 | agg_id, col_id, is_distinct = col_unit |
no test coverage detected