Skip to content

Commit

Permalink
fix(sql_crud): handle missing data
Browse files Browse the repository at this point in the history
  • Loading branch information
zieka committed Apr 12, 2024
1 parent 8ebd873 commit 98387b9
Show file tree
Hide file tree
Showing 2 changed files with 3,131 additions and 10 deletions.
24 changes: 14 additions & 10 deletions moderne_visualizations_misc/sql_crud.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"source": [
"from code_data_science import data_table as dt, data_grid as moderne_data_grid\n",
"\n",
"df = dt.read_csv(\"../samples/sql_crud.csv\")\n",
"df = dt.read_csv(\"../samples/test.csv\")\n",
"\n",
"if len(filter_operations_to) > 0:\n",
" df = df[df[\"operation\"].isin(filter_operations_to)]\n",
Expand Down Expand Up @@ -62,7 +62,10 @@
" Returns:\n",
" str: link to the source code in the repository\n",
" \"\"\"\n",
" url = repositoryLink.rstrip('/') # Remove any trailing slash to ensure URL consistency\n",
" if type(repositoryLink) != str or type(scmType) != str :\n",
" return \"\"\n",
" \n",
" url = repositoryLink\n",
"\n",
" if scmType == \"GITHUB\":\n",
" if sourcePath:\n",
Expand Down Expand Up @@ -93,14 +96,15 @@
"\n",
"df[\"Link\"] = \"\"\n",
"\n",
"try:\n",
" df[\"Link\"] = df.apply(\n",
" lambda row: create_link(\n",
" row[\"repositoryLink\"], row[\"scmType\"], row[\"File\"], row[\"lineNumber\"]\n",
" ), axis=1\n",
" ) \n",
"except:\n",
" pass"
"\n",
"df[\"Link\"] = df.apply(\n",
" lambda row: create_link(\n",
" row.get('repositoryLink', \"\"),\n",
" row.get('scmType', \"\"),\n",
" row.get('File', \"\"),\n",
" row.get('lineNumber',\"\")\n",
" ), axis=1\n",
") "
]
},
{
Expand Down
Loading

0 comments on commit 98387b9

Please sign in to comment.