コード例 #1
0
ファイル: test_inference.py プロジェクト: jordrop/dagster
def test_infer_output_description_from_docstring_rest():
    @solid
    def rest(_context) -> int:
        """
        :return int: a number
        """

    props = infer_output_props(rest.compute_fn)
    assert props.description == "a number"
    assert props.annotation == int
コード例 #2
0
def test_infer_output_description_from_docstring_google():
    @solid
    def google(_context) -> int:
        """
        Returns:
            int: a number
        """

    props = infer_output_props(google.compute_fn.decorated_fn)

    assert props.description == "a number"
    assert props.annotation == int
コード例 #3
0
def test_infer_output_description_from_docstring_numpy():
    @solid
    def numpy(_context) -> int:
        """

        Returns
        -------
        int
            a number
        """

    props = infer_output_props(numpy.compute_fn.decorated_fn)
    assert props.description == "a number"
    assert props.annotation == int