databricks/Spark-The-Definitive-Guide

color_locator() error? Chapter 6 p. 96

evohnave opened this issue · 7 comments

recommend:

def color_locator(column, color_string):
return locate(color_string.upper(), column)
.cast("boolean")
.alias("is_" + color_string) # existing code has 'c' instead of 'color_string' - doesn't work

Could you please file this on the errata page?

https://www.oreilly.com/catalog/errata.csp?isbn=0636920034957

O'Reilly's errata page is down... I went there first, then came here.

Will do... pretty sure I'm right... ran your code got errors, ran mine, no errors, correct output

that would suggest that you're right ;)

OK, think I did that correctly... first PR... everyone's got to have a first, right?

Indeed! Nice work, thanks.