Hacker News new | ask | show | jobs
by a_better_world 127 days ago
Soooo many times in my career I've had to come back and "extract that variable into a function" that I just do it right away by force of habit.

Point is, this isn't trivial, it is the kind of thing that ends up saving work over the long haul.

Or include this in my agent 'rules' files.

GOOD EXAMPLE

query=f""" SELECT foo FROM {sometable} WHERE {condition} """ answer=spark.sql(query).toPandas()

BAD EXAMPLE

answer=spark.sql(f""" SELECT foo FROM {sometable} WHERE {condition} """).toPandas()