示例#1
0
def test_schema_infer(dataframe):
    expect = {
        'type':
        'record',
        'name':
        'Root',
        'fields': [
            {
                'type': ['null', 'boolean'],
                'name': 'Boolean'
            },
            {
                'type':
                ['null', {
                    'logicalType': 'timestamp-micros',
                    'type': 'long'
                }],
                'name':
                'DateTime64'
            },
            {
                'type': ['null', 'double'],
                'name': 'Float64'
            },
            {
                'type': ['null', 'long'],
                'name': 'Int64'
            },
            {
                'type': ['null', 'string'],
                'name': 'String'
            },
        ]
    }
    assert expect == pdx.__schema_infer(dataframe)
示例#2
0
def test_schema_infer(dataframe):
    expect = {
        'type':
        'record',
        'name':
        'Root',
        'fields': [{
            'type': ['null', 'boolean'],
            'name': 'Boolean'
        }, {
            'type': ['null', 'double'],
            'name': 'Float64'
        }, {
            'type': ['null', 'long'],
            'name': 'Int64'
        }, {
            'type': ['null', 'string'],
            'name': 'String'
        }]
    }
    assert expect == pdx.__schema_infer(dataframe)