azure.databricks.cicd.tools icon indicating copy to clipboard operation
azure.databricks.cicd.tools copied to clipboard

Add FilePattern param to Import-DatabricksFolder method

Open NowinskiK opened this issue 5 years ago • 6 comments

Would be good to have param like -FilePattern for this command to be able filtering files in the selected path. Example: Import-DatabricksFolder -BearerToken $token -Region $region -LocalPath 'c:\repo\Databricks\' -DatabricksPath '/Shared/Project1' -FilePattern 'ag*.py'

NowinskiK avatar Apr 03 '19 18:04 NowinskiK

What would be the use case for this? Currently it imports all files in the folder that match a valid type:

$FileType = @{".py"="PYTHON";".scala"="SCALA";".r"="R";".sql"="SQL" }

If there is something else (like a .txt file) you will get a warning that it could not be uploaded.

My view is that you want the local folder to match the target folder - therefore all files should be uploaded.

I'm open to ideas though.

simondmorias avatar Apr 03 '19 19:04 simondmorias

Yes, I know. I checked the code, but that would help if one (or more) of your files are valid but you don't want to push it/them to the notebook. It might be many various scenarios for people; for me right now is a simple thing: I have 1 file (test.ipynb) which is for tests purposes and I don't want to push it to Production environment (non-prod is fine). Obviously, the parameter is optional. BTW 'ipynb' is not supported by the module right now, but I will create a separate issue for this.

NowinskiK avatar Apr 03 '19 19:04 NowinskiK

Is there a way to only upload a file? Because it seems that you maybe want to upload an specific notebook to databricks.

Thank you.

matallanas avatar Oct 30 '19 18:10 matallanas

If the -FilePattern parameter just matches a single file then yes it will upload just the one file.

simondmorias avatar Oct 30 '19 19:10 simondmorias

But there is no -FilePattern, right?

matallanas avatar Oct 30 '19 21:10 matallanas

@simondmorias As there is a possibility to add files with extensions other than those listed above, is there any chance to update the code to deploy files, not only notebooks?

ekdz avatar May 18 '23 13:05 ekdz