BrokenPipe ErrorNo32

Hi There,
Totally new to erpnext
I am getting a brokenpipe 32
this error is appears, with passing the parameter and without paramters also.
from this code:

import frappe

def emploc(employee=None):
if not employee:
return {“error”: “No / Invalid employee ID”}

    loc = frappe.db.sql(
        """SELECT ec.employee, ec.employee_name, ec.device_id, ec.time, e.department, e.payroll_cost_center, f.file_url
           FROM `tabEmployee Checkin` ec
           INNER JOIN `tabEmployee` e ON ec.employee =
           LEFT JOIN `tabFile` f ON f.attached_to_name = e.user_id AND (f.file_url LIKE '%.png' OR f.file_url LIKE '%.jpg') AND f.attached_to_field = 'user_image'
           WHERE ec.log_type = 'IN' AND ec.employee = %s""",
    return loc
except Exception as e:
    print(f"Error: {e}")

Secondly, As I have 0 experience in erpnext / frappe, can anyone please recommend me a good source to learn ERPNEXT /FRAPPE in depth/ extensively.

THANK YOU :innocent: