Skip to content

Commit

Permalink
Avoid issue #21 by reverting to string variant
Browse files Browse the repository at this point in the history
For now, we comment out the use of annotations from the __future__
module and use the "old" way with string notation for type annotations
refering to the 'self' class.
  • Loading branch information
MaximilianFranz committed Feb 18, 2020
1 parent 6da3457 commit 9b03aeb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/justcause/data/frames.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"""
Generalised DataFrame which differentiates between covariates and other column names
"""
from __future__ import annotations
# Uncomment only when we require Python >= 3.7
# from __future__ import annotations

from abc import ABC
from functools import partial
Expand Down Expand Up @@ -69,7 +70,7 @@ def __init__(self, data, *args, **kwargs):
self._names = dict(covariates=covariates)

@property
def _constructor(self) -> partial[CausalFrame]:
def _constructor(self) -> partial["CausalFrame"]:
# This is called during operations with CausalFrames
# We pass a marker to differentiate between explicit and implicit invocation
kwargs = {"_internal_operation": True, **self._names}
Expand Down

0 comments on commit 9b03aeb

Please sign in to comment.