Function that works in python but sql doesn't pyspark

Carlos José González Arenas 1 Reputation point
2022-03-18T20:34:47.37+00:00

Function that works in python but sql doesn't pyspark

I have successfully performed a function, and I have used it without problems, python, I have seen in videos and I have read that it can be implemented in both contexts, but I cannot do it myself

Here is an image where I use it in python and then in another cell I use it in sql, and the error message appears

184656-funcionregistrada.png

Function applied

184731-functionaplicada.png

Error message PythonException: 'AttributeError: 'NoneType' object has no attribute '_tools''

but if the geocode function works, it is because it is registered, I installed arcgis, and then I did this

%python
import unicodedata
from pathlib import Path
import pyspark.sql.functions as function
from pyspark.sql.types import *
import pandas as pd
import numpy as np
import re

import utm

import arcgis
from arcgis.geocoding import reverse_geocode
from arcgis.gis import GIS
from arcgis.geocoding import geocode
from arcgis.gis import GIS

Azure Databricks
Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
1,938 questions
.NET Machine learning
.NET Machine learning
.NET: Microsoft Technologies based on the .NET software framework.Machine learning: A type of artificial intelligence focused on enabling computers to use observed data to evolve new behaviors that have not been explicitly programmed.
150 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Carlos José González Arenas 1 Reputation point
    2022-03-23T17:37:17.42+00:00

    186241-image.png

    186169-image.png

    186205-image.png

    0 comments No comments