示例#1
0
def test_get_dataset_schema(s):
    destination = FileUtils.get_destination(TEST_RESOURCES, s)
    schema = None

    if FileUtils.is_valid_file(destination):
        schema = DaveEngine.get_dataset_schema(destination)
        assert schema is not None
示例#2
0
def get_dataset_schema(filename, target):
    destination = get_destination(filename, target)
    if not destination:
        return common_error("Invalid file or cache key")

    schema = DaveEngine.get_dataset_schema(destination)
    return json.dumps(schema, cls=NPEncoder)
示例#3
0
def get_dataset_schema(filename, target):
    destination = get_destination(filename, target)
    if not destination:
        return common_error("Invalid file or cache key, filename: %s" % filename)

    schema = DaveEngine.get_dataset_schema(destination)
    return json.dumps(schema, cls=NPEncoder)
示例#4
0
def test_get_dataset_schema(s):
    destination = FileUtils.get_destination(TEST_RESOURCES, s)
    schema = None

    if destination:
        schema = DaveEngine.get_dataset_schema(destination)

    assert not os.path.isfile(destination) or schema != None
示例#5
0
def get_dataset_schema (filename, target):
    if not filename:
        return common_error(error = "No filename setted" )

    if not session['uploaded_filename'] or session['uploaded_filename'] != filename:
        return common_error("Filename not uploaded" )

    destination = FileUtils.get_destination(target, filename)
    if not destination:
        return common_error("Error opening file")

    schema = DaveEngine.get_dataset_schema(destination)
    return json.dumps( schema )
示例#6
0
def get_dataset_schema(filename, target):
    if not filename:
        return common_error(error="No filename setted")

    if not session['uploaded_filename'] or session['uploaded_filename'] != filename:
        return common_error("Filename not uploaded")

    destination = FileUtils.get_destination(target, filename)
    if not FileUtils.is_valid_file(destination):
        return common_error("Invalid file")

    schema = DaveEngine.get_dataset_schema(destination)
    return json.dumps(schema, cls=NPEncoder)
示例#7
0
def get_dataset_schema(filename, target):
    if not filename:
        return common_error(error="No filename setted")

    if not session[
            'uploaded_filename'] or session['uploaded_filename'] != filename:
        return common_error("Filename not uploaded")

    destination = FileUtils.get_destination(target, filename)
    if not destination:
        return common_error("Error opening file")

    schema = DaveEngine.get_dataset_schema(destination)
    return json.dumps(schema)