Project

General

Profile

« Previous | Next » 

Revision 5816

sql_gen.py: If no cols had srcs, return [] instead of the [()] that itertools.product() would have returned

View differences:

lib/sql_gen.py
392 392
def cross_join_srcs(cols):
393 393
    cols = filter(has_srcs, cols) # empty srcs will mess up the cross join
394 394
    srcs = [[s.name for s in c.srcs] for c in cols]
395
    if not srcs: return [] # itertools.product() returns [()] for empty input
395 396
    return [Col(','.join(s)) for s in itertools.product(*srcs)]
396 397

  
397 398
class NamedCol(Col):

Also available in: Unified diff