utils/file-tester/lms_file_tester/validators/file_validation.py
def validate_sections_file(input_directory: str) -> List[str]:
    """
    Validates that the latest sections file has the expected columns and all
    columns whose names end with `Date` or `DateTime` have the proper format.

    Parameters
    ----------
    input_directory: str
        Base / parent directory containing files created by an LMS extractor.

    Returns
    -------
    List[str]
        List containing detailed error messages, if any.
    """
    df = fread.get_all_sections(input_directory, nrows=2)

    if df.empty:
        return _file_is_empty("Sections")

    expected = set(
        [
            "SourceSystemIdentifier",
            "SourceSystem",
            "SISSectionIdentifier",
            "Title",
            "SectionDescription",
            "Term",
            "LMSSectionStatus",
            "CreateDate",
            "LastModifiedDate",
            "SourceCreateDate",
            "SourceLastModifiedDate",
        ]
    )

    return _validate_columns(
        expected, df, "Sections"
    ) + _validate_date_formats(df, "Sections")

    Validates that the latest sections file has the expected columns and all
    columns whose names end with `Date` or `DateTime` have the proper format.

    Parameters
    ----------
    input_directory: str
        Base / parent directory containing files created by an LMS extractor.

    Returns
    -------
    List[str]
        List containing detailed error messages, if any.
    
Validates that the latest sections file has the expected columns and all
columns whose names end with `Date` or `DateTime` have the proper format.

Parameters

str
Base / parent directory containing files created by an LMS extractor.

Returns

List[str]
List containing detailed error messages, if any.
Validates that the latest sections file has the expected columns and all columns whose names end with ` Date ` or ` DateTime ` have the proper format . Parameters str Base / parent directory containing files created by an LMS extractor . Returns List [ str ] List containing detailed error messages if any .
def validate_sections_file(input_directory: str) -> List[str]:
    df = fread.get_all_sections(input_directory, nrows=2)
    if df.empty:
        return _file_is_empty("Sections")
    expected = set(
        [
            "SourceSystemIdentifier",
            "SourceSystem",
            "SISSectionIdentifier",
            "Title",
            "SectionDescription",
            "Term",
            "LMSSectionStatus",
            "CreateDate",
            "LastModifiedDate",
            "SourceCreateDate",
            "SourceLastModifiedDate",
        ]
    )
    return _validate_columns(
        expected, df, "Sections"
    ) + _validate_date_formats(df, "Sections")
def validate_sections_file ( input_directory : str ) -> List [ str ] : df = fread . get_all_sections ( input_directory , nrows = 2 ) if df . empty : return _file_is_empty ( "Sections" ) expected = set ( [ "SourceSystemIdentifier" , "SourceSystem" , "SISSectionIdentifier" , "Title" , "SectionDescription" , "Term" , "LMSSectionStatus" , "CreateDate" , "LastModifiedDate" , "SourceCreateDate" , "SourceLastModifiedDate" , ] ) return _validate_columns ( expected , df , "Sections" ) + _validate_date_formats ( df , "Sections" )
Validates that the latest sections file has the expected columns and all
columns whose names end with `Date` or `DateTime` have the proper format.
Validates that the latest sections file has the expected columns and all columns whose names end with ` Date ` or ` DateTime ` have the proper format .
"""
    Validates that the latest sections file has the expected columns and all
    columns whose names end with `Date` or `DateTime` have the proper format.

    Parameters
    ----------
    input_directory: str
        Base / parent directory containing files created by an LMS extractor.

    Returns
    -------
    List[str]
        List containing detailed error messages, if any.
    """
input_directory
str