Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor use of name, tmp, show triplet #31

Closed
abelsiqueira opened this issue May 6, 2024 · 1 comment · Fixed by #70
Closed

Refactor use of name, tmp, show triplet #31

abelsiqueira opened this issue May 6, 2024 · 1 comment · Fixed by #70

Comments

@abelsiqueira
Copy link
Member

There are $2^3 = 8$ possibilities. Refactor so these are clear.
Possibly create a function to assist.

A possible implementation is using Val. E.g.,

function foo(::Val{true}, x)
  return x + 1
end

function foo(::Val{false}, x)
  return x - 1
end

function foo(x)
  if x > 0
    return foo(Val(true), x)
  else
    return foo(Val(false), x)
  end
end
@suvayu
Copy link
Member

suvayu commented Aug 8, 2024

Some notes on behaviour, for a given source:

  1. source is a file:
    return show ? DataFrame(...) | table_name

    name tmp remarks
    non-empty as provided
    empty true table name: t_<safe_filename>
    empty false table name: <safe_filename>

    The above behaviour reduces the coupled possibilities to only 2. When name is empty, the generated table name differs based on tmp.

  2. source is another table: TBD since now the scope of TIO also
    includes use as a library by TEM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants