diff --git a/.gitignore b/.gitignore
index 456846f..78112ac 100644
--- a/.gitignore
+++ b/.gitignore
@@ -334,3 +334,4 @@ ASALocalRun/
 /.idea/checkstyle-idea.xml
 *.iml
 /.idea/misc.xml
+/venv
diff --git a/pykusto/functions.py b/pykusto/functions.py
index 8450ef8..210958f 100644
--- a/pykusto/functions.py
+++ b/pykusto/functions.py
@@ -120,6 +120,8 @@ def ceiling(expr: NumberType) -> NumberExpression:
 
 def cos(expr: NumberType) -> NumberExpression:
     return expr.cos()
+
+
 #
 # def cot(self): return
 
@@ -257,12 +259,12 @@ def hourofday(expr: DatetimeType) -> NumberExpression:
     return expr.hourofday()
 
 
-def iif(predicate: BooleanType, if_true: ExpressionType, if_false: ExpressionType) -> BaseExpression:
-    return BaseExpression(KQL('iif({}, {}, {})'.format(predicate, if_true, if_false)))
+def iff(predicate: BooleanType, if_true: ExpressionType, if_false: ExpressionType) -> BaseExpression:
+    return BaseExpression(KQL('iff({}, {}, {})'.format(predicate, _subexpr_to_kql(if_true), _subexpr_to_kql(if_false))))
 
 
-def iff(predicate: BooleanType, if_true: ExpressionType, if_false: ExpressionType) -> BaseExpression:
-    return BaseExpression(KQL('iff({}, {}, {})'.format(predicate, if_true, if_false)))
+def iif(predicate: BooleanType, if_true: ExpressionType, if_false: ExpressionType) -> BaseExpression:
+    return iff(predicate, if_true, if_false)
 
 
 #
diff --git a/pykusto/query.py b/pykusto/query.py
index 5025977..b7157fb 100644
--- a/pykusto/query.py
+++ b/pykusto/query.py
@@ -12,7 +12,7 @@ from pykusto.expressions import BooleanType, ExpressionType, AggregationExpressi
     StringType, AssignmentBase, AssignmentFromAggregationToColumn, AssignmentToSingleColumn, Column, BaseExpression, \
     AssignmentFromColumnToColumn
 from pykusto.udf import stringify_python_func
-from pykusto.utils import KQL, logger
+from pykusto.utils import KQL, logger, to_kql
 
 
 class Order(Enum):
@@ -137,7 +137,10 @@ class Query:
             else:
                 assignments.append(arg)
         for column_name, expression in kwargs.items():
-            assignments.append(expression.assign_to(Column(column_name)))
+            if isinstance(expression, BaseExpression):
+                assignments.append(expression.assign_to(Column(column_name)))
+            else:
+                assignments.append(BaseExpression(to_kql(expression)).assign_to(Column(column_name)))
         return ExtendQuery(self, *assignments)
 
     def summarize(self, *args: Union[AggregationExpression, AssignmentFromAggregationToColumn],
diff --git a/setup.py b/setup.py
index 605de64..b31e771 100644
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
 
 setup(
     name='pykusto',
-    version='0.0.4',
+    version='0.0.5',
     packages=find_packages(exclude=['test']),
     url='https://github.com/Azure/pykusto',
     license='MIT License',

diff --git a/test/test_expressions.py b/test/test_expressions.py
index 3074ef4..7c42e8a 100644
--- a/test/test_expressions.py
+++ b/test/test_expressions.py
@@ -55,6 +55,16 @@ class TestExpressions(TestBase):
             " | extend ['foo.bar'] = (shoo * 2)",
             Query().extend((col.shoo * 2).assign_to(col.foo.bar)).render(),
         )
+        self.assertEqual(
+            " | extend foo = (shoo * 2)",
+            Query().extend(foo=(col.shoo * 2)).render(),
+        )
+
+    def test_extend_const(self):
+        self.assertEqual(
+            " | extend foo = (5), bar = (\"bar\"), other_col = other",
+            Query().extend(foo=5, bar="bar", other_col=col.other).render(),
+        )
 
     def test_between_timespan(self):
         self.assertEqual(
diff --git a/test/test_functions.py b/test/test_functions.py
index 247142d..55fc998 100644
--- a/test/test_functions.py
+++ b/test/test_functions.py
@@ -7,7 +7,7 @@ from pykusto.query import Query
 from test.test_base import TestBase
 
 
-# TODO dcount_hll, iif
+# TODO dcount_hll
 
 class TestFunction(TestBase):
     def test_acos(self):
@@ -629,3 +629,16 @@ class TestFunction(TestBase):
             " | summarize active_days = dcount(bin(timestamp, time(1.0:0:0.0)))",
             Query().summarize(active_days=f.dcount(f.bin(col.timestamp, datetime.timedelta(1)))).render()
         )
+
+    def test_iff(self):
+        self.assertEqual(
+            " | project foo = (iff(foo > (ago(time(2.0:0:0.0))), time(3.0:0:0.0), time(4.0:0:0.0)))",
+            Query().project(foo=f.iff(col.foo > f.ago(datetime.timedelta(2)), datetime.timedelta(3), datetime.timedelta(4))).render()
+        )
+
+    def test_iif(self):
+        # iif is just an alias to iff
+        self.assertEqual(
+            " | project foo = (iff(foo > (ago(time(2.0:0:0.0))), time(3.0:0:0.0), time(4.0:0:0.0)))",
+            Query().project(foo=f.iif(col.foo > f.ago(datetime.timedelta(2)), datetime.timedelta(3), datetime.timedelta(4))).render()
+        )

iff doesn't support sub expressions
The following syntax is not working:
.extend(timeDelta=iff(col.day-col.day1 == 0, timedelta(DAYS_BACK_DIFF), col.day-col.day1))
test/test_expressions.py::TestExpressions::test_extend_const test/test_functions.py::TestFunction::test_iff test/test_functions.py::TestFunction::test_iif
test/test_expressions.py::TestExpressions::test_array_access test/test_expressions.py::TestExpressions::test_array_access_expression_index test/test_expressions.py::TestExpressions::test_assign_to test/test_expressions.py::TestExpressions::test_between_timespan test/test_expressions.py::TestExpressions::test_column_generator test/test_expressions.py::TestExpressions::test_column_generator_2 test/test_expressions.py::TestExpressions::test_contains test/test_expressions.py::TestExpressions::test_has test/test_expressions.py::TestExpressions::test_is_empty test/test_expressions.py::TestExpressions::test_is_in test/test_expressions.py::TestExpressions::test_mapping_access test/test_expressions.py::TestExpressions::test_mapping_access_expression_index test/test_expressions.py::TestExpressions::test_method_does_not_exist test/test_expressions.py::TestExpressions::test_not_contains test/test_functions.py::TestFunction::test_acos test/test_functions.py::TestFunction::test_ago test/test_functions.py::TestFunction::test_any test/test_functions.py::TestFunction::test_arg_max test/test_functions.py::TestFunction::test_arg_min test/test_functions.py::TestFunction::test_array_length test/test_functions.py::TestFunction::test_avgif test/test_functions.py::TestFunction::test_bag_keys test/test_functions.py::TestFunction::test_bin test/test_functions.py::TestFunction::test_bin_at test/test_functions.py::TestFunction::test_bin_auto test/test_functions.py::TestFunction::test_case test/test_functions.py::TestFunction::test_ceiling test/test_functions.py::TestFunction::test_cos test/test_functions.py::TestFunction::test_count test/test_functions.py::TestFunction::test_countif test/test_functions.py::TestFunction::test_dcount test/test_functions.py::TestFunction::test_endofday test/test_functions.py::TestFunction::test_endofmonth test/test_functions.py::TestFunction::test_endofweek test/test_functions.py::TestFunction::test_exp test/test_functions.py::TestFunction::test_exp10 test/test_functions.py::TestFunction::test_exp2 test/test_functions.py::TestFunction::test_floor test/test_functions.py::TestFunction::test_format_datetime test/test_functions.py::TestFunction::test_format_timespan test/test_functions.py::TestFunction::test_getmonth test/test_functions.py::TestFunction::test_gettype test/test_functions.py::TestFunction::test_getyear test/test_functions.py::TestFunction::test_hash test/test_functions.py::TestFunction::test_hash_sha256 test/test_functions.py::TestFunction::test_hourofday test/test_functions.py::TestFunction::test_isempty test/test_functions.py::TestFunction::test_isfinite test/test_functions.py::TestFunction::test_isinf test/test_functions.py::TestFunction::test_isnan test/test_functions.py::TestFunction::test_isnotempty test/test_functions.py::TestFunction::test_isnotnull test/test_functions.py::TestFunction::test_isnull test/test_functions.py::TestFunction::test_isutf8 test/test_functions.py::TestFunction::test_log test/test_functions.py::TestFunction::test_log10 test/test_functions.py::TestFunction::test_log2 test/test_functions.py::TestFunction::test_loggamma test/test_functions.py::TestFunction::test_make_bag test/test_functions.py::TestFunction::test_make_datetime test/test_functions.py::TestFunction::test_make_list test/test_functions.py::TestFunction::test_make_set test/test_functions.py::TestFunction::test_max test/test_functions.py::TestFunction::test_min test/test_functions.py::TestFunction::test_nesting test/test_functions.py::TestFunction::test_now test/test_functions.py::TestFunction::test_percentile test/test_functions.py::TestFunction::test_percentiles test/test_functions.py::TestFunction::test_pow test/test_functions.py::TestFunction::test_round test/test_functions.py::TestFunction::test_sign test/test_functions.py::TestFunction::test_sqrt test/test_functions.py::TestFunction::test_startofday test/test_functions.py::TestFunction::test_startofmonth test/test_functions.py::TestFunction::test_startofweek test/test_functions.py::TestFunction::test_startofyear test/test_functions.py::TestFunction::test_stdev test/test_functions.py::TestFunction::test_stdevif test/test_functions.py::TestFunction::test_stdevp test/test_functions.py::TestFunction::test_strcat test/test_functions.py::TestFunction::test_strcat_array test/test_functions.py::TestFunction::test_strcat_delim test/test_functions.py::TestFunction::test_strcmp test/test_functions.py::TestFunction::test_string_size test/test_functions.py::TestFunction::test_strlen test/test_functions.py::TestFunction::test_strrep test/test_functions.py::TestFunction::test_substring test/test_functions.py::TestFunction::test_sum test/test_functions.py::TestFunction::test_sumif test/test_functions.py::TestFunction::test_tobool test/test_functions.py::TestFunction::test_toboolean test/test_functions.py::TestFunction::test_todouble test/test_functions.py::TestFunction::test_variance test/test_functions.py::TestFunction::test_varianceif test/test_functions.py::TestFunction::test_variancep