Skip to content

Commit

Permalink
Modified concatenate_tables to remove if args.cat
Browse files Browse the repository at this point in the history
  • Loading branch information
Acribbs committed Aug 23, 2024
1 parent 05b8beb commit 5ccc752
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions cgat/tools/tables2table.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,16 +280,19 @@ def main(argv=sys.argv):

E.info("combining %i tables" % len(args.filenames))

if args.cat:
table = concatenate_tables(args.filenames,
regex_filename=args.regex_filename,
separator=args.separator,
headers=args.headers,
missing_value=args.missing_value,
cat=args.cat)

table.to_csv(args.stdout, sep=args.separator, index=False)
E.stop()
# Remove the if statement and call concatenate_tables directly
table = concatenate_tables(args.filenames,
regex_filename=args.regex_filename,
separator=args.separator,
headers=args.headers,
missing_value=args.missing_value,
cat=args.cat)

# Ensure the table object is not None before attempting to write it
if table is not None:
table.to_csv(args.stdout, sep=args.separator, index=False)
else:
E.warn("No tables were concatenated.")


if __name__ == '__main__':
Expand Down

0 comments on commit 5ccc752

Please sign in to comment.