title: Keep Feature Definitions in Dictionary and Rerturn the feature to the client
body: <p>I have below dictionary   for keeping  feature definitions as strings.</p>
  <pre><code>    features = {
    &quot;journey_email_been_sent_flag&quot;: &quot;F.when(F.col('email_14days') &gt; 0,F.lit(1)).otherwise(F.lit(0))&quot;,
    &quot;journey_opened_flag&quot;: &quot;F.when(F.col('opened_14days') &gt; 0, F.lit(1)).otherwise(F.lit(0))&quot;
  }
  retrieved_features = {}
  non_retrieved_features = {}
  </code></pre>
  <p>Or keeping it as definition itself.</p>
  <pre><code>    features = {
    &quot;journey_email_been_sent_flag&quot;: F.when(F.col('email_14days') &gt; 0,F.lit(1)).otherwise(F.lit(0)),
    &quot;journey_opened_flag&quot;: F.when(F.col('opened_14days') &gt; 0, F.lit(1)).otherwise(F.lit(0))
  }
  </code></pre>
  <p>Then below code for retrieving the feature definitions</p>
  <pre><code> def feature_extract(*featurenames):
    for featurename in featurenames:
      if featurename in features:
        print(f&quot;{featurename} : {features[featurename]}&quot;)
        retrieved_features[featurename] = features[featurename]
      else:
        print('failure')
        non_retrieved_features[featurename] = &quot;Not Found in the feature defenition&quot;
    return retrieved_features
  </code></pre>
  <p>And this is how I call the function for retrieving the features</p>
  <pre><code>feature_extract('journey_email_been_sent_flag','journey_opened_flag')
  </code></pre>
  <p>However its not working when I am trying to retrieve the future , i receive the below result when keeping the definition in dictionary</p>
  <pre><code>Out[19]: {'journey_email_been_sent_flag': Column&lt;b'CASE WHEN (email_14days &gt; 0) THEN 1 ELSE 0 END'&gt;}
  </code></pre>
  <p>when i call the retrieval of feature as below in the dataframe.</p>
  <pre><code>.withColumn('journey_email_been_sent_flag', feature_extract('journey_email_been_sent_flag'))
  </code></pre>
  <p>getting below error</p>
  <pre><code>AssertionError: col should be Column
  </code></pre>