Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

unclosed ssl.SSLSocket warning when finishing a run #437

Open
chamini2 opened this issue Jul 4, 2022 · 0 comments
Open

unclosed ssl.SSLSocket warning when finishing a run #437

chamini2 opened this issue Jul 4, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@chamini2
Copy link
Member

chamini2 commented Jul 4, 2022

Describe the bug
I'm trying to set up a fal script to send a message to slack if a source fails a freshness test (using the functionality added in this PR, very exciting work btw!). I'm getting an issue with SSL sockets; details in thread. I'd appreciate any help, thanks!

sys:1: ResourceWarning: unclosed <ssl.SSLSocket fd=10, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=(...), raddr=(...)>

Your environment

  • OS: [TODO]
  • Paste the following commands output: [TODO]
fal --version
dbt --version
  • Adapter being used: [TODO]

How to reproduce
[TODO]

Expected behavior
No warning about unclosed sockets.

Additional context
Script:

import os
from slack_sdk import WebClient
from slack_sdk.errors import SlackApiError
from fal import FalDbt
from fal import DbtSource

CHANNEL_ID = os.getenv("SLACK_BOT_CHANNEL")
SLACK_TOKEN = os.getenv("SLACK_BOT_TOKEN")

client = WebClient(token=SLACK_TOKEN)
faldbt = FalDbt(project_dir='.', profiles_dir='.')

try:
    sources = faldbt.list_sources()
    for node in sources:
        if node.freshness and node.freshness.status != 'pass':
            freshness_message_text = f"Source: {node.name}.{node.table_name}, Status: {node.freshness.status}, Owner: <@will>"
            print(freshness_message_text)
            #response = client.chat_postMessage(
            #    channel=CHANNEL_ID,
            #    text=freshness_message_text
            #)

except SlackApiError as e:
    # You will get a SlackApiError if "ok" is False
    assert e.response["error"]

Information being reported and updated from a thread in #tools-fal channel of dbt slack.

@chamini2 chamini2 added the bug Something isn't working label Jul 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant