Skip to content

Frends.azure data lake.list files#18

Open
MichalFrends1 wants to merge 4 commits intomainfrom
Frends.AzureDataLake.ListFiles
Open

Frends.azure data lake.list files#18
MichalFrends1 wants to merge 4 commits intomainfrom
Frends.AzureDataLake.ListFiles

Conversation

@MichalFrends1
Copy link
Copy Markdown
Contributor

Issue 10

@MichalFrends1 MichalFrends1 requested a review from jefim May 27, 2024 07:34
@MichalFrends1 MichalFrends1 self-assigned this May 27, 2024
@jefim jefim linked an issue May 30, 2024 that may be closed by this pull request
public string ContainerName { get; set; }

/// <summary>
/// Name of the Azure Data Lake directory specifies the path where the data will be uploaded.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix comment

public string ClientSecret { get; set; }

/// <summary>
/// Name of the Azure Data Lake container where the data will be uploaded.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix comment

/// The type of the item (either "File" or "Directory").
/// </summary>
/// <example>File</example>
public string Type { get; set; }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets mimic the same Azure thing, so would be just bool IsDirectory


try
{
if (options.ListingStructure == ListingStructure.Flat)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets remove the options.ListingStructure altogether and simply replace it with a flag bool Recursive. This will simplify code and make it easier to understand for the user.

Comment thread Frends.AzureDataLake.ListFiles/README.md
Comment on lines +105 to +122
foreach (var isRecursive in recursiveOptions)
{
var options = new Options
{
DictionaryName = "Temp",
Recursive = isRecursive,
};

var result = await AzureDataLake.ListFiles(source, options, default);

Assert.IsTrue(result.FileList.Any(x => x.Name == "Temp/SubFolderFile"));
Assert.IsTrue(result.FileList.Any(x => x.Name == "Temp/SubFolderFile2"));
Assert.IsTrue(result.FileList.Any(x => x.URL.Contains("/Temp/SubFolderFile")));
Assert.IsTrue(result.FileList.Any(x => x.URL.Contains("/Temp/SubFolderFile2")));

Assert.IsFalse(result.FileList.Any(x => x.Name == "TestFile.txt"));
Assert.IsFalse(result.FileList.Any(x => x.Name == "TestFile2.txt"));
}

Check notice

Code scanning / CodeQL

Missed opportunity to use Select

This foreach loop immediately [maps its iteration variable to another variable](1) - consider mapping the sequence explicitly using '.Select(...)'.
Comment on lines +203 to +220
foreach (var isRecursive in recursiveOptions)
{
var options = new Options
{
DictionaryName = "Temp",
Recursive = isRecursive,
};

var result = await AzureDataLake.ListFiles(source, options, default);

Assert.IsTrue(result.FileList.Any(x => x.Name == "Temp/SubFolderFile"));
Assert.IsTrue(result.FileList.Any(x => x.Name == "Temp/SubFolderFile2"));
Assert.IsTrue(result.FileList.Any(x => x.URL.Contains("/Temp/SubFolderFile")));
Assert.IsTrue(result.FileList.Any(x => x.URL.Contains("/Temp/SubFolderFile2")));

Assert.IsFalse(result.FileList.Any(x => x.Name == "TestFile.txt"));
Assert.IsFalse(result.FileList.Any(x => x.Name == "TestFile2.txt"));
}

Check notice

Code scanning / CodeQL

Missed opportunity to use Select

This foreach loop immediately [maps its iteration variable to another variable](1) - consider mapping the sequence explicitly using '.Select(...)'.
Comment on lines +54 to +57
catch (Exception ex)
{
throw new ArgumentException("ListFileHandler error: ", ex);
}

Check notice

Code scanning / CodeQL

Generic catch clause

Generic catch clause.
@github-actions
Copy link
Copy Markdown

CodeQL found vulnerabilities from the code. Check the PR or the workflow summary for the details: https://github.com/FrendsPlatform/Frends.AzureDataLake/actions/runs/9319381442?pr=18

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2024

CodeQL found vulnerabilities from the code. Check the PR or the workflow summary for the details: https://github.com/FrendsPlatform/Frends.AzureDataLake/actions/runs/9345458004?pr=18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Frends.AzureDataLake.ListFiles

3 participants