Skip to content

Commit

Permalink
remove unused get_csv_parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
dale-wahl committed Feb 20, 2025
1 parent 69ac83c commit aa33afd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
7 changes: 0 additions & 7 deletions backend/lib/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -884,13 +884,6 @@ def exclude_followup_processors(cls, processor_type):
"""
return False

@classmethod
def get_csv_parameters(cls, csv_library):
"""
Returns CSV parameters if they are changed from 4CAT's defaults.
"""
return {}

@abc.abstractmethod
def process(self):
"""
Expand Down
9 changes: 1 addition & 8 deletions common/lib/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,6 @@ def _iterate_items(self, processor=None):
# Yield through items one by one
if path.suffix.lower() == ".csv":
with path.open("rb") as infile:
# Processor (that created this dataset) may have a custom CSV dialect and parameters
own_processor = self.get_own_processor()
csv_parameters = own_processor.get_csv_parameters(csv) if own_processor else {}

wrapped_infile = NullAwareTextIOWrapper(infile, encoding="utf-8")
reader = csv.DictReader(wrapped_infile, **csv_parameters)

Expand Down Expand Up @@ -634,10 +630,7 @@ def is_rankable(self, multiple_items=True):
column_options.add("word_1")

with self.get_results_path().open(encoding="utf-8") as infile:
own_processor = self.get_own_processor()
csv_parameters = own_processor.get_csv_parameters(csv) if own_processor else {}

reader = csv.DictReader(infile, **csv_parameters)
reader = csv.DictReader(infile, {})
try:
return len(set(reader.fieldnames) & column_options) >= 3
except (TypeError, ValueError):
Expand Down

0 comments on commit aa33afd

Please sign in to comment.