私は政府提供のデータを扱わなければなりませんが、奇妙な方法で壊れていることがあります。私のコードには、次のようなスニペットが既に含まれています。
for row in governmental_data:
# XXX Workaround for that one row among thousands
# that was mislabeled by a clerk and will not be fixed
# before form A-320-Tango-5 is completed and submitted
# on the first Sunday after a solstice.
if row is the_spawn_of_satan:
row = fix_row_A320(row)
# XXX end of workaround
process_row(row)
エラーの前は
for row in governmental_data:
process_row(row)
データは動的であるため、修正を適用したデータのミラーを作成できません。
これらの回避策の数が増えるにつれて、これらの回避策を管理するにはどうすればよいですか? ベスト プラクティスはありますか (「壊れたデータを最初から提供しない」以外に)?