Skip to content

Commit

Permalink
SplinkDataFrame -> ABC
Browse files Browse the repository at this point in the history
  • Loading branch information
ADBond committed Mar 12, 2024
1 parent a3bfea2 commit 1ac70d3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions splink/splink_dataframe.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import logging
from abc import ABC, abstractmethod, abstractproperty
from pathlib import Path
from typing import TYPE_CHECKING

Expand All @@ -13,7 +14,7 @@
from .database_api import DatabaseAPI


class SplinkDataFrame:
class SplinkDataFrame(ABC):
"""Abstraction over dataframe to handle basic operations like retrieving data and
retrieving column names, which need different implementations depending on whether
it's a spark dataframe, sqlite table etc.
Expand All @@ -35,7 +36,7 @@ def __init__(
self.sql_used_to_create = None
self.metadata = metadata or {}

@property
@abstractproperty
def columns(self) -> list[InputColumn]:
pass

Expand All @@ -44,6 +45,7 @@ def columns_escaped(self):
cols = self.columns
return [c.name for c in cols]

@abstractmethod
def validate(self):
pass

Expand Down

0 comments on commit 1ac70d3

Please sign in to comment.