Revision 2820
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql.py | ||
---|---|---|
778 | 778 |
'''Casts an (unrenamed) column or value. |
779 | 779 |
If errors_table set and col has srcs, saves errors in errors_table (using |
780 | 780 |
col's srcs attr as the source columns) and converts errors to warnings. |
781 |
@param col sql_gen.Col|sql_gen.Literal |
|
781 |
@param col str|sql_gen.Col|sql_gen.Literal
|
|
782 | 782 |
@param errors_table None|sql_gen.Table|str |
783 | 783 |
''' |
784 |
col = sql_gen.as_Col(col) |
|
784 | 785 |
save_errors = (errors_table != None and isinstance(col, sql_gen.Col) |
785 | 786 |
and col.srcs != ()) |
786 | 787 |
if not save_errors: # can't save errors |
Also available in: Unified diff
sql.py: cast(): Support string column name inputs