https://dagster.io/ logo
#ask-community
Title
# ask-community
f

Fred Benton

05/15/2023, 2:26 PM
In the following test:
Copy code
def test_pipeline_assets():  
     result = (
        materialize_to_memory(
            assets=[get_stuff],
            resources={
                "conn": redshift_connection,
                "pipeline_configuration": {
                    "target_district": "BLORG",
                    "source_schema": "FOO",
                    "output_schema": "BAR",
                },
            },
        ),
    )
    assert result.success
I get the error: AttributeError: 'tuple' object has no attribute 'success' what attribute of result should I use instead of success?
d

daniel

05/15/2023, 2:39 PM
Hi Fred - this looks like a Python gotcha to me that I've been bit by several times before- you're actually setting
result
to a Python tuple with a single element
(Because of stray parentheses and commas)
f

Fred Benton

05/15/2023, 2:40 PM
Can you make a quick recommendation?
a

Adam Bloom

05/15/2023, 2:40 PM
Copy code
def test_pipeline_assets():  
     result = materialize_to_memory(
        assets=[get_stuff],
        resources={
            "conn": redshift_connection,
            "pipeline_configuration": {
                "target_district": "BLORG",
                "source_schema": "FOO",
                "output_schema": "BAR",
            },
        },
    )
    assert result.success
try that 🙂
🙏 1
The syntax you had before with an extra set of parenthesis can be used to split long lines into multiple lines, especially with chaining (I use it a lot in sqlalchemy), but that last
,
is what was converting it to a tuple instead.
f

Fred Benton

05/15/2023, 2:42 PM
Thank you very much
3 Views