def test_wf1_with_sql_with_patch():
    sql = SQLTask('my-query', query_template="SELECT * FROM hive.city.fact_airport_sessions WHERE ds = '{{ .Inputs.ds }}' LIMIT 10", inputs=kwtypes(ds=datetime.datetime), outputs=kwtypes(results=FlyteSchema), metadata=TaskMetadata(retries=2))

    @task
    def t1() -> datetime.datetime:
        return datetime.datetime.now()

    @workflow
    def my_wf() -> FlyteSchema:
        dt = t1()
        return sql(ds=dt)

    @patch(sql)
    def test_user_demo_test(mock_sql):
        mock_sql.return_value = pandas.DataFrame(data={'x': [1, 2], 'y': ['3', '4']})
        assert (my_wf().open().all() == pandas.DataFrame(data={'x': [1, 2], 'y': ['3', '4']})).all().all()
    test_user_demo_test()
def test_wf1_with_sql_with_patch():
    sql = SQLTask('my-query', query_template="SELECT * FROM hive.city.fact_airport_sessions WHERE ds = '{{ .Inputs.ds }}' LIMIT 10", inputs=kwtypes(ds=datetime.datetime), outputs=kwtypes(results=FlyteSchema), metadata=TaskMetadata(retries=2))

    @task
    def t1() -> datetime.datetime:
        return datetime.datetime.now()

    @workflow
    def my_wf() -> FlyteSchema:
        dt = t1()
        return sql(ds=dt)

    @patch(sql)
    def test_user_demo_test(mock_sql):
        mock_sql.return_value = pandas.DataFrame(data={'x': [1, 2], 'y': ['3', '4']})
        assert (my_wf().open().all() == pandas.DataFrame(data={'x': [1, 2], 'y': ['3', '4']})).all().all()
    test_user_demo_test()