utils/file-tester/lms_file_tester/validators/file_validation.py
def validate_users_file(input_directory: str) -> List[str]:
    """
    Validates that the latest users 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_users(input_directory, nrows=2)

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

    expected = set(
        [
            "SourceSystemIdentifier",
            "SourceSystem",
            "UserRole",
            "LocalUserIdentifier",
            "SISUserIdentifier",
            "Name",
            "EmailAddress",
            "CreateDate",
            "LastModifiedDate",
            "SourceCreateDate",
            "SourceLastModifiedDate",
        ]
    )

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

    Validates that the latest users 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 users 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 users 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_users_file(input_directory: str) -> List[str]:
    df = fread.get_all_users(input_directory, nrows=2)
    if df.empty:
        return _file_is_empty("Users")
    expected = set(
        [
            "SourceSystemIdentifier",
            "SourceSystem",
            "UserRole",
            "LocalUserIdentifier",
            "SISUserIdentifier",
            "Name",
            "EmailAddress",
            "CreateDate",
            "LastModifiedDate",
            "SourceCreateDate",
            "SourceLastModifiedDate",
        ]
    )
    return _validate_columns(
        expected, df, "Users"
    ) + _validate_date_formats(df, "Users")
def validate_users_file ( input_directory : str ) -> List [ str ] : df = fread . get_all_users ( input_directory , nrows = 2 ) if df . empty : return _file_is_empty ( "Users" ) expected = set ( [ "SourceSystemIdentifier" , "SourceSystem" , "UserRole" , "LocalUserIdentifier" , "SISUserIdentifier" , "Name" , "EmailAddress" , "CreateDate" , "LastModifiedDate" , "SourceCreateDate" , "SourceLastModifiedDate" , ] ) return _validate_columns ( expected , df , "Users" ) + _validate_date_formats ( df , "Users" )
Validates that the latest users file has the expected columns and all
columns whose names end with `Date` or `DateTime` have the proper format.
Validates that the latest users file has the expected columns and all columns whose names end with ` Date ` or ` DateTime ` have the proper format .
"""
    Validates that the latest users 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