diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ac9389..88a336b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ * Snakemake-wrappers up to 3.3.3 * Snakemake 8+ compatibility +## Fix: + +* csv.Sniffer getting too much data + # 2.2.7 ## Features: diff --git a/workflow/rules/common.smk b/workflow/rules/common.smk index 263d0cd..700c19b 100644 --- a/workflow/rules/common.smk +++ b/workflow/rules/common.smk @@ -23,7 +23,7 @@ snakemake.utils.validate(config, "../schemas/config.schema.yaml") # Load and check samples properties table sample_table_path: str = config.get("samples", "config/samples.csv") with open(sample_table_path, "r") as sample_table_stream: - dialect: csv.Dialect = csv.Sniffer().sniff(sample_table_stream.read(1024)) + dialect: csv.Dialect = csv.Sniffer().sniff(sample_table_stream.readline()) sample_table_stream.seek(0) samples: pandas.DataFrame = pandas.read_csv( @@ -41,7 +41,7 @@ snakemake.utils.validate(samples, "../schemas/samples.schema.yaml") genome_table_path: str = config.get("genomes") if genome_table_path: with open(genome_table_path, "r") as genome_table_stream: - dialect: csv.Dialect = csv.Sniffer().sniff(genome_table_stream.read(1024)) + dialect: csv.Dialect = csv.Sniffer().sniff(genome_table_stream.readline()) genome_table_stream.seek(0) genomes: pandas.DataFrame = pandas.read_csv(