You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
""" replace_value!(jws::JSONWorksheet, ::Val{T}, cols::Vector)'Val{T}'별로 지정된 규칙으로 주어진 값을 변환한다 'drop_empty': 빈 array '[]' 컬럼을 삭제한다'empty_to_null': 빈 array '[]'를 'null'로 변경'drop_nullmember': object에서 value가 'null'인 경우 컬럼 삭제"""functionreplace_value!(jws::JSONWorksheet, ::Val{T}, cols::Vector) where T
@warn"$(sheetnames(jws))에 정의되지 않은 operation $(T)을 시도했습니다"endfunctionreplace_value!(jws::JSONWorksheet, ::Val{:drop_empty}, cols::Vector)
@inboundsfor row in jws.data
for p in JSONPointer.Pointer.(cols)
row[p] =filter(!isempty, row[p])
endendendfunctionreplace_value!(jws::JSONWorksheet, ::Val{:empty_to_null}, cols::Vector)
for row in jws.data
for p in JSONPointer.Pointer.(cols)
ifisempty(row[p])
row[p] =missingendendendendfunctionreplace_value!(jws::JSONWorksheet, ::Val{:drop_nullmember}, cols::Vector)
for row in jws.data
for p in JSONPointer.Pointer.(cols)
ifisa(row[p], AbstractDict)
for (k, v) in row[p]
ifisnull(v)
delete!(row[p], k)
endendendendendend
MWE
currently this give us
it will be convinient if we give a option to
Or more general interface of replace certain value would be desired?
The text was updated successfully, but these errors were encountered: